diff options
| author | 2018-08-13 12:19:59 -0400 | |
|---|---|---|
| committer | 2018-08-13 12:19:59 -0400 | |
| commit | f19b4fab5ff470c060f93eac454bb351e7e37225 (patch) | |
| tree | 47eb63b32088feac194e06ed76d028717213ff86 /src/audio_core/audio_renderer.cpp | |
| parent | Merge pull request #1053 from MerryMage/rm-IsExecuting (diff) | |
| parent | audio_renderer: samples_remaining counts frames, not samples (diff) | |
| download | yuzu-f19b4fab5ff470c060f93eac454bb351e7e37225.tar.gz yuzu-f19b4fab5ff470c060f93eac454bb351e7e37225.tar.xz yuzu-f19b4fab5ff470c060f93eac454bb351e7e37225.zip | |
Merge pull request #1033 from MerryMage/interp
audio_core: Interpolate
Diffstat (limited to 'src/audio_core/audio_renderer.cpp')
| -rw-r--r-- | src/audio_core/audio_renderer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index 6ebed3fb0..397b107f5 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include "audio_core/algorithm/interpolate.h" | ||
| 5 | #include "audio_core/audio_renderer.h" | 6 | #include "audio_core/audio_renderer.h" |
| 6 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 7 | #include "common/logging/log.h" | 8 | #include "common/logging/log.h" |
| @@ -199,6 +200,8 @@ void AudioRenderer::VoiceState::RefreshBuffer() { | |||
| 199 | break; | 200 | break; |
| 200 | } | 201 | } |
| 201 | 202 | ||
| 203 | samples = Interpolate(interp_state, std::move(samples), Info().sample_rate, STREAM_SAMPLE_RATE); | ||
| 204 | |||
| 202 | is_refresh_pending = false; | 205 | is_refresh_pending = false; |
| 203 | } | 206 | } |
| 204 | 207 | ||
| @@ -224,7 +227,7 @@ void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) { | |||
| 224 | break; | 227 | break; |
| 225 | } | 228 | } |
| 226 | 229 | ||
| 227 | samples_remaining -= samples.size(); | 230 | samples_remaining -= samples.size() / stream->GetNumChannels(); |
| 228 | 231 | ||
| 229 | for (const auto& sample : samples) { | 232 | for (const auto& sample : samples) { |
| 230 | const s32 buffer_sample{buffer[offset]}; | 233 | const s32 buffer_sample{buffer[offset]}; |