Qt: Reset audio output when changing sample size
Jeffrey Pfau jeffrey@endrift.com
Tue, 11 Nov 2014 01:25:46 -0800
1 files changed,
3 insertions(+),
2 deletions(-)
M
src/platform/qt/AudioProcessor.cpp
→
src/platform/qt/AudioProcessor.cpp
@@ -59,8 +59,9 @@ }
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); } }