pandap / slimdx

Automatically exported from code.google.com/p/slimdx
MIT License
0 stars 0 forks source link

WaveStream makes incorrect decision for the use of WAVEFORMATEXTENSIBLE #776

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the WaveStream class, the decision to use WAVEFORMATEXTENSIBLE is incorrect. 
It only checks if the format is PCM and in that case correctly uses 
WAVEFORMATEX, but it incorrectly decides to use WAVEFORMATEXTENSIBLE in all 
other cases.

Line 123: if( pcmFormat.wf.wFormatTag == WAVE_FORMAT_PCM )

According to the MSDN documentation there are other decisions to be made for 
formats other than PCM:

See
http://msdn.microsoft.com/en-us/library/microsoft.directx_sdk.xaudio2.waveformat
ex%28v=vs.85%29.aspx

For example, ADPCM (which I tested and can be played by XAudio2) requires you 
to use the ADPCMWAVEFORMAT struct. xWMA requires the WAVEFORMATEXTENSIBLE 
struct ONLY when it contains more than 2 channels, otherwise it must be read 
with just the WAVEFORMATEX struct.

Original issue reported on code.google.com by klapstoe...@gmail.com on 23 Jan 2011 at 8:42

GoogleCodeExporter commented 9 years ago

Original comment by josh.petrie on 2 Feb 2011 at 5:10

GoogleCodeExporter commented 9 years ago
Fixed in r2086. I wasn't able to test it, so you'll have to try it out for me.

Original comment by Mike.Popoloski on 14 Jun 2011 at 4:43