From bc091dd122b2b29bfa9203acaf6f48b23a32688d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 4 Jul 2024 11:10:39 +0200 Subject: [PATCH] Tweak audio discard constants --- client/audio/android/audio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/audio/android/audio.cpp b/client/audio/android/audio.cpp index 70c2510a..e39de473 100644 --- a/client/audio/android/audio.cpp +++ b/client/audio/android/audio.cpp @@ -88,8 +88,8 @@ int32_t wivrn::android::audio::speaker_data_cb(AAudioStream * stream, void * use // If we have more than 80ms of buffered data, discard some data if (self->buffer_size_bytes > frame_size * AAudioStream_getSampleRate(stream) * 0.08) { - // discard excess data until we only have 40ms left - size_t target_buffer_size = frame_size * AAudioStream_getSampleRate(stream) * 0.04; + // discard excess data until we only have 60ms left + size_t target_buffer_size = frame_size * AAudioStream_getSampleRate(stream) * 0.06; while (self->buffer_size_bytes > target_buffer_size and self->output_buffer.size() > 1) { auto tmp = self->output_buffer.read();