Qt: Reset audio output when changing sample size

This commit is contained in:
Jeffrey Pfau 2014-11-11 01:25:46 -08:00
parent 5c0c966a74
commit 20c5c27bf9
1 changed files with 3 additions and 2 deletions

View File

@ -59,8 +59,9 @@ void AudioProcessor::pause() {
void AudioProcessor::setBufferSamples(int samples) {
if (m_audioOutput) {
QAudioFormat format = m_audioOutput->format();
m_audioOutput->setBufferSize(samples * format.channelCount() * format.sampleSize() / 8);
m_audioOutput->stop();
m_audioOutput->setBufferSize(samples * 4);
m_audioOutput->start(m_device);
}
}