From a6efff8b02986daf6d3660c4f33c5f39cf3f3830 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Thu, 23 Aug 2018 14:33:03 +0200 Subject: Add audio stretching support --- src/audio_core/stream.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/audio_core/stream.cpp') diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index dbae75d8c..49c6efc85 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp @@ -90,6 +90,7 @@ void Stream::PlayNextBuffer() { queued_buffers.pop(); VolumeAdjustSamples(active_buffer->Samples()); + sink_stream.EnqueueSamples(GetNumChannels(), active_buffer->GetSamples()); CoreTiming::ScheduleEventThreadsafe(GetBufferReleaseCycles(*active_buffer), release_event, {}); -- cgit v1.2.3 From 957ddab6796cb6f644c60993c3035d8bd9c0a398 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Wed, 12 Sep 2018 18:07:16 +0100 Subject: audio_core: Flush stream when not playing anything --- src/audio_core/stream.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/audio_core/stream.cpp') diff --git a/src/audio_core/stream.cpp b/src/audio_core/stream.cpp index 49c6efc85..84dcdd98d 100644 --- a/src/audio_core/stream.cpp +++ b/src/audio_core/stream.cpp @@ -73,6 +73,7 @@ static void VolumeAdjustSamples(std::vector& samples) { void Stream::PlayNextBuffer() { if (!IsPlaying()) { // Ensure we are in playing state before playing the next buffer + sink_stream.Flush(); return; } @@ -83,6 +84,7 @@ void Stream::PlayNextBuffer() { if (queued_buffers.empty()) { // No queued buffers - we are effectively paused + sink_stream.Flush(); return; } -- cgit v1.2.3