Ошибка QAudioOutput: snd_pcm_hw_params_set_buffer_time_near: err = -22

Я использую следующий код для воспроизведения файла WAV:

inputFile.setFileName("/accounts/1000/appdata/com.example.SoundR.testDev_mple_SoundRe6609254/data/tracks/rec.wav");
inputFile.open(QIODevice::ReadOnly);

QAudioFormat format;
// Set up the format, eg.
format.setSampleRate(16000);
format.setChannelCount(1);
format.setSampleSize(16);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
format.setSampleType(QAudioFormat::UnSignedInt);

QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
if (!info.isFormatSupported(format)) {
qWarning() << "Raw audio format not supported by backend, cannot play audio.";
format = info.nearestFormat(format);
}

audioOutput = new QAudioOutput(format, this);

connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State)));
connect(audioOutput, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State)));

audioOutput->start(&inputFile);

Но я получаю ошибку:

"QAudioOutput: snd_pcm_hw_params_set_buffer_time_near: err = -22"

Я получил это от этот урок.

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector