Help !

hi,

I have to play ADPCM.
I need to config my sound card for that.

All my tries was failed:
I tried to set in the structure WAVEFORMATEX in the member wFormatTag the value WAVE_FORMAT_ADPCM (in memreg.h) but when I call the function waveOutOpen the return value is WAVERR_BADFORMAT (Attempted to open with an unsupported waveform-audio format.).

The audio is encoded ADPCM
Comprassion Ratio - 1:4 (Each 4 bits equals 16 bits decoded)
Sample Rate - 8000
BitsPerSample - 4
Mono


Big thank you !!!!
Because the Windows Sound System hardware only understands 8/16-bit PCM, the computer must compress and decompress the ADPCM into/from PCM, which requires CPU time.


Taken from http://support.microsoft.com/kb/89879
I do not realy understood.
The meaning is that i have to decompress the file myself ?!

So, how the sound card play adpcm ? why the define WAVE_FORMAT_ADPCM exist ?
The meaning is that i have to decompress the file myself ?!

(Assuming for the moment that the Waveform Audio Functions are the right way to go...)

Yes. In the sense that you have to get the required ACM codec from the Audio Compression Manager (ACM) and then use it to decode the ADPCM data to PCM format using acmStreamConvert before calling waveOutWrite (as modoran has already mentioned.)

You only have to write your own decompression code if you want to use a format for which there is no pre-existing ACM codec.

why the define WAVE_FORMAT_ADPCM exist

Because the format exists?

how the sound card play adpcm ?

If it doesn't support the format directly, it can't.

So you use the appropriate ACM codec to decompress to data to PCM and use this new data instead (as said above.)

And...

I have to play ADPCM.

When you say "play ADPCM", are you talking about playing an ADPCM wav file? Or is this data coming from somewhere else?

Note that the Waveform Audio Functions are legacy. They have been superseded twice: first by DirectShow and more recently by Media Foundation.

Andy

PS You should consider changing the title of your thread to something more informative than "Help !" ?? See the Edit Topic button above the opening post.
Last edited on
Topic archived. No new replies allowed.