diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-09-06 23:13:57 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-09-06 23:13:57 -0300 |
commit | 5f0d367fef25b30742ba71f12e339137e02c59ab (patch) | |
tree | ddf008297b73fa303b26459cc9d0373c415295c0 /modules/stb_vorbis | |
parent | 8047127bc642d0074db0dd8982c2d28ab524f299 (diff) |
Mono vorbis support fixed, closes #10787
Diffstat (limited to 'modules/stb_vorbis')
-rw-r--r-- | modules/stb_vorbis/audio_stream_ogg_vorbis.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp index df427907f8..9457fbfaf6 100644 --- a/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.cpp @@ -45,6 +45,12 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra while (todo && active) { int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, (float *)p_buffer, todo * 2); + if (vorbis_stream->channels == 1 && mixed > 0) { + //mix mono to stereo + for (int i = 0; i < mixed; i++) { + p_buffer[i].r = p_buffer[i].l; + } + } todo -= mixed; frames_mixed += mixed; |