Archived

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

CrushingHellHammer

Format support in DirectSound

Recommended Posts

Does DirectSound (DX9) offer support for the mp3 format or is support restricted only to .wav? Also, how about audio CD file formats? If the answer to the above questions is no, how does one enable an application to play these formats? Basically what I''m trying to get at is to code an app that plays mp3 files or CDs. I''m just getting started with C# .NET and working on a project that interests me would keep me interested and enable me to learn quicker.

Share this post


Link to post
Share on other sites
IIRC, DirectSound only plays native wav files. It doesn''t do any decoding. However...DirectShow does.

The MP3 question has been brought up a lot on this forum, so a search should yield some results. Also, check out the ''Jukebox'' DirectShow sample. It will play a lot of media formats, such as MP3 and WMV.

Share this post


Link to post
Share on other sites
I just checked the "samples" that came with the DX SDK and apparently DX 9 supports playback of a number of formats. Here is the filter for the "file open dialog"

private string filterText = "Video Files (*.avi; *.qt; *.mov; *.mpg; *.mpeg; *.m1v; *.wmv)|*.avi; *.qt; *.mov; *.mpg; *.mpeg; *.m1v; *.wmv|" +

Audio files (*.wav; *.mpa; *.mp2; *.mp3; *.au; *.aif; *.aiff; *.snd; *.wma)|*.wav; *.mpa; *.mp2; *.mp3; *.au; *.aif; *.aiff; *.snd; *.wma|" +

"MIDI Files (*.mid, *.midi, *.rmi)|*.mid; *.midi; *.rmi|" +

"Image Files (*.jpg, *.bmp, *.gif, *.tga)|*.jpg; *.bmp; *.gif; *.tga|" +

"All Files (*.*)|*.*";

The example is primitive in terms of controls but seems to be a good starting point.

Is DirectShow not supported in C#? There are no examples for DirectShow in C#.

Share this post


Link to post
Share on other sites