From 991cdda3fc536e7d674205a4f1b54465562974e3 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Wed, 7 Sep 2016 15:26:38 +0100 Subject: audio_core: Tweak audio latency --- src/audio_core/hle/dsp.cpp | 2 +- src/audio_core/sdl2_sink.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/audio_core') diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp index 0cddeb82a..1420bf2dd 100644 --- a/src/audio_core/hle/dsp.cpp +++ b/src/audio_core/hle/dsp.cpp @@ -105,7 +105,7 @@ static void OutputCurrentFrame(const StereoFrame16& frame) { std::vector stretched_samples = time_stretcher.Process(sink->SamplesInQueue()); sink->EnqueueSamples(stretched_samples.data(), stretched_samples.size() / 2); } else { - constexpr size_t maximum_sample_latency = 1024; // about 32 miliseconds + constexpr size_t maximum_sample_latency = 2048; // about 64 miliseconds if (sink->SamplesInQueue() > maximum_sample_latency) { // This can occur if we're running too fast and samples are starting to back up. // Just drop the samples. diff --git a/src/audio_core/sdl2_sink.cpp b/src/audio_core/sdl2_sink.cpp index 311dd5b59..1d7912715 100644 --- a/src/audio_core/sdl2_sink.cpp +++ b/src/audio_core/sdl2_sink.cpp @@ -38,7 +38,7 @@ SDL2Sink::SDL2Sink() : impl(std::make_unique()) { desired_audiospec.format = AUDIO_S16; desired_audiospec.channels = 2; desired_audiospec.freq = native_sample_rate; - desired_audiospec.samples = 1024; + desired_audiospec.samples = 512; desired_audiospec.userdata = impl.get(); desired_audiospec.callback = &Impl::Callback; -- cgit v1.2.3