LibAudio: Fixed stuttery playback of audio

When playing an ABuffer, the count of samples were determined by the
size of the SharedBuffer. This caused small pauses of up to 512
samples during the playback, when the size of the shared buffer was
rounded up to a multiple of 4096. This problem was amplified by the
fact that the AResampleHelper was created every time a new chunk of
audio was to be processed, causing inconsistencies in the playback of
wav files.
This commit is contained in:
Till Mayer
2019-10-16 15:31:01 +02:00
committed by Andreas Kling
parent 7e97e1c5d9
commit 4c8341d080
6 changed files with 78 additions and 62 deletions

View File

@@ -68,6 +68,6 @@ OwnPtr<AudioServer::EnqueueBufferResponse> ASClientConnection::handle(const Audi
if (m_queue->is_full())
return make<AudioServer::EnqueueBufferResponse>(false);
m_queue->enqueue(ABuffer::create_with_shared_buffer(*shared_buffer));
m_queue->enqueue(ABuffer::create_with_shared_buffer(*shared_buffer, message.sample_count()));
return make<AudioServer::EnqueueBufferResponse>(true);
}