Skip to content

Commit

Permalink
HLE DSP: Stub audio output
Browse files Browse the repository at this point in the history
  • Loading branch information
wheremyfoodat committed Nov 18, 2024
1 parent e22bc58 commit 66be960
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/core/audio/hle_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ namespace Audio {

if (audioEnabled) {
// Wait until we've actually got room to push our frame
while (sampleBuffer.size() + 2 > sampleBuffer.Capacity()) {
while (sampleBuffer.size() + frame.size() * 2 > sampleBuffer.Capacity()) {
std::this_thread::sleep_for(std::chrono::milliseconds{1});
}

sampleBuffer.push(frame.data(), frame.size());
sampleBuffer.push(frame.data(), frame.size() * 2);
}
}

Expand Down Expand Up @@ -276,6 +276,12 @@ namespace Audio {
}
}

for (int i = 0; i < Audio::samplesInFrame; i++) {
auto& mix0 = mixes[0];
auto& sample = mix0[i];
frame[i] = {s16(sample[0]), s16(sample[2])};
}

performMix(read, write);
}

Expand Down

0 comments on commit 66be960

Please sign in to comment.