fix(audio:windows): set cbSize correctly (#1787)

This commit is contained in:
everything411 2023-10-27 21:28:29 +08:00 committed by GitHub
parent ab3ff2d355
commit 842a4cf7b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -156,7 +156,7 @@ namespace platf::audio {
wave_format.Format.wBitsPerSample = 16;
wave_format.Format.nBlockAlign = wave_format.Format.nChannels * wave_format.Format.wBitsPerSample / 8;
wave_format.Format.nAvgBytesPerSec = wave_format.Format.nSamplesPerSec * wave_format.Format.nBlockAlign;
wave_format.Format.cbSize = sizeof(wave_format);
wave_format.Format.cbSize = sizeof(WAVEFORMATEXTENSIBLE) - sizeof(WAVEFORMATEX);
wave_format.Samples.wValidBitsPerSample = 16;
wave_format.dwChannelMask = format.channel_mask;