From f4d364a60e77c1423b4bb9ea9d0b0a58cbac29e7 Mon Sep 17 00:00:00 2001
From: MerryMage <MerryMage@users.noreply.github.com>
Date: Sun, 15 May 2016 12:51:04 +0100
Subject: [PATCH] DSP/HLE: Audio output

---
 src/audio_core/hle/dsp.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp
index 1c00ed472..0640e1eff 100644
--- a/src/audio_core/hle/dsp.cpp
+++ b/src/audio_core/hle/dsp.cpp
@@ -88,6 +88,11 @@ static StereoFrame16 GenerateCurrentFrame() {
 static std::unique_ptr<AudioCore::Sink> sink;
 static AudioCore::TimeStretcher time_stretcher;
 
+static void OutputCurrentFrame(const StereoFrame16& frame) {
+    time_stretcher.AddSamples(&frame[0][0], frame.size());
+    sink->EnqueueSamples(time_stretcher.Process(sink->SamplesInQueue()));
+}
+
 // Public Interface
 
 void Init() {
@@ -121,6 +126,8 @@ bool Tick() {
     // TODO: Check dsp::DSP semaphore (which indicates emulated application has finished writing to shared memory region)
     current_frame = GenerateCurrentFrame();
 
+    OutputCurrentFrame(current_frame);
+
     return true;
 }