mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-27 17:42:40 -06:00
DSP/HLE: Audio output
This commit is contained in:
parent
6542c60602
commit
f4d364a60e
1 changed files with 7 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue