Archived

This topic is now archived and is closed to further replies.

how to deal with audio in all kinds of format?

This topic is 5652 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to develope a audio analyses system and can support most kinds of format.But the directsound can support wav format only. I want to find a way that can decode these formats and put the data had decoded into directsound buffer to process.Is this way viable? what method should I use?

Share this post


Link to post
Share on other sites
Actually DirectSound uses PCM data, now wav data. There is a difference. For example, I wrote a DirectSound-based sound system which could play Ogg Vorbis since the Ogg Vorbis code provided a decoder which decoded into PCM format. As long as you can decode what you want to play into PCM format, you can play it through DirectSound buffers.

Share this post


Link to post
Share on other sites
if you just want to analyze audio, either:

1. use directshow to support anything it supports (mp3, wma, etc)
2. winamp plugin, which will support for anything the user has a plugin for
3. support only reading wavs and focre the user to convert
4. if realtime, read data from the sound card (ie mic, line in, wavout, mix, midi, etc) via directsoundcapture. MUST run in realtime, but can support anything playable through the sound card like radio, guitar, mp3 (any decoder), wma, ogg, etc. there will be some latency, but nothing too high.

personally i think realtime processing would be best (for analysis) but the may not be possible depending on how you are exactly trying to analyzing the audio.

also, yes you can capture audio, process it, then play it back through directsound with acceptable latency. the dx sdk has an example of this (though it uses buffers that are chunked a bit large).

Share this post


Link to post
Share on other sites