Qt MediaPlayer не воспроизводит звук [закрыто]C++

Программы на C++. Форум разработчиков
Ответить
Anonymous
 Qt MediaPlayer не воспроизводит звук [закрыто]

Сообщение Anonymous »


I am trying to make an application where there is a looping background music. I have added the bgm m4a file into the project via CMake. The code in MainWindow is below.

ui->setupUi(this); screamer = new QMediaPlayer(this); audioOutput = new QAudioOutput(this); screamer->setAudioOutput(audioOutput); QString filePath = "bgm.m4a"; qDebug() setSource(QUrl::fromLocalFile(filePath)); audioOutput->setVolume(40); screamer->play(); qDebug() errorString(); Now I am quite sure that the bgm.m4a file was correctly named, the errorString() returns "", and all the codes are executed in the correct order, but there is no sound coming out of my speakers. What am I doing wrong here?


Источник: https://stackoverflow.com/questions/780 ... play-audio
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C++»