1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

thirdparty/sokol: apply speaker/headset bug fix from latest upstream sokol_audio.h (#14676)

This commit is contained in:
Wertzui123 2022-06-04 19:24:07 +02:00 committed by GitHub
parent 3c5ae41712
commit d71fd04c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1611,7 +1611,12 @@ _SOKOL_PRIVATE bool _saudio_backend_init(void) {
fmtex.Format.nAvgBytesPerSec = fmtex.Format.nSamplesPerSec * fmtex.Format.nBlockAlign;
fmtex.Format.cbSize = 22; /* WORD + DWORD + GUID */
fmtex.Samples.wValidBitsPerSample = 32;
fmtex.dwChannelMask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT;
if (_saudio.num_channels == 1) {
fmtex.dwChannelMask = SPEAKER_FRONT_CENTER;
}
else {
fmtex.dwChannelMask = SPEAKER_FRONT_LEFT|SPEAKER_FRONT_RIGHT;
}
fmtex.SubFormat = _saudio_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
dur = (REFERENCE_TIME)
(((double)_saudio.buffer_frames) / (((double)_saudio.sample_rate) * (1.0/10000000.0)));