Skip to content

Commit d71fd04

Browse files
authored
thirdparty/sokol: apply speaker/headset bug fix from latest upstream sokol_audio.h (#14676)
1 parent 3c5ae41 commit d71fd04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

thirdparty/sokol/sokol_audio.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,12 @@ _SOKOL_PRIVATE bool _saudio_backend_init(void) {
16111611
fmtex.Format.nAvgBytesPerSec = fmtex.Format.nSamplesPerSec * fmtex.Format.nBlockAlign;
16121612
fmtex.Format.cbSize = 22; /* WORD + DWORD + GUID */
16131613
fmtex.Samples.wValidBitsPerSample = 32;
1614-
fmtex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
1614+
if (_saudio.num_channels == 1) {
1615+
fmtex.dwChannelMask = SPEAKER_FRONT_CENTER;
1616+
}
1617+
else {
1618+
fmtex.dwChannelMask = SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT;
1619+
}
16151620
fmtex.SubFormat = _saudio_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
16161621
dur = (REFERENCE_TIME)
16171622
(((double)_saudio.buffer_frames) / (((double)_saudio.sample_rate) * (1.0/10000000.0)));

0 commit comments

Comments
 (0)