From 5982a3825df53ef52908eb3843063fffecb0ab4a Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 14 Feb 2017 20:49:28 -1000 Subject: [PATCH] Use 15ms buffers in AQS --- lib/audiodev/AQS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/audiodev/AQS.cpp b/lib/audiodev/AQS.cpp index 19d41d9..da643ee 100644 --- a/lib/audiodev/AQS.cpp +++ b/lib/audiodev/AQS.cpp @@ -704,7 +704,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine while (chMapOut.m_channelCount < chCount) chMapOut.m_channels[chMapOut.m_channelCount++] = AudioChannel::Unknown; - m_mixInfo.m_periodFrames = 1200 * size_t(actualSampleRate) / 48000; + m_mixInfo.m_periodFrames = m_5msFrames * 3; for (int i=0 ; i<3 ; ++i) if (AudioQueueAllocateBuffer(m_queue, m_mixInfo.m_periodFrames * chCount * 4, &m_buffers[i])) { @@ -718,7 +718,7 @@ struct AQSAudioVoiceEngine : BaseAudioVoiceEngine for (unsigned i=0 ; i<3 ; ++i) { - _pumpAndMixVoices(m_mixInfo.m_periodFrames, reinterpret_cast(m_buffers[i]->mAudioData)); + memset(m_buffers[i]->mAudioData, 0, m_frameBytes); m_buffers[i]->mAudioDataByteSize = m_frameBytes; AudioQueueEnqueueBuffer(m_queue, m_buffers[i], 0, nullptr); }