Skip to content

Commit 5f0d367

Browse files
committedSep 7, 2017
Mono vorbis support fixed, closes #10787
1 parent 8047127 commit 5f0d367

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎modules/stb_vorbis/audio_stream_ogg_vorbis.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ void AudioStreamPlaybackOGGVorbis::_mix_internal(AudioFrame *p_buffer, int p_fra
4545
while (todo && active) {
4646

4747
int mixed = stb_vorbis_get_samples_float_interleaved(ogg_stream, 2, (float *)p_buffer, todo * 2);
48+
if (vorbis_stream->channels == 1 && mixed > 0) {
49+
//mix mono to stereo
50+
for (int i = 0; i < mixed; i++) {
51+
p_buffer[i].r = p_buffer[i].l;
52+
}
53+
}
4854
todo -= mixed;
4955
frames_mixed += mixed;
5056

0 commit comments

Comments
 (0)
Please sign in to comment.