Jump to content
  • Advertisement
Sign in to follow this  
Sargos

Game Sound - DirectSound with mp3 or Ogg

This topic is 4864 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

First off, I am under the assumption that the majority of big name titles use DirectSound for their sound effects and music. Is this correct? Also I see a lot of games using mp3 or Ogg files for their sound but as far as I can tell, DirectSound can only handle .wav files. How do these games play these files? Do they use a decoder to translate their sound files into .wav at runtime or does some method of DirectSound actually play them? P.S. This arose from trying to add sound to my first game. It was written in C# and uses Managed DirectX, so maybe MDX just isn't as powerful as the real thing. If there is a better managed sound system I could use I would be eternally grateful if someone pointed it out to me :-)

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Sargos
P.S. This arose from trying to add sound to my first game. It was written in C# and uses Managed DirectX, so maybe MDX just isn't as powerful as the real thing. If there is a better managed sound system I could use I would be eternally grateful if someone pointed it out to me :-)

If you are playing full songs instead of just sound snippets take a look at "Microsoft.DirectX.AudioVideoPlayback". The Audio class in that namespace is more suited for playing back longer items because it handles streaming them into memory for you. I haven't actually tested it with mp3 but I know wma's and midi's work, so I would guess so. You might have to figure out something to make ogg work, it might be as simple as installing the codec.

The other alternative is to use FMOD. It is another major sound/music library that has bindings for .Net, and I've heard good things about it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
OpenAL if you want anything portable or just plain good. It's been used in quite a few professional games too.

Share this post


Link to post
Share on other sites
[shamelessplug]My .NET Ogg Vorbis decoder... I still haven't gotten around to adding quite a few things to it (seeking for example, but I've been busy with other things lately) but for just straight playback it's fine.[/shamelessplug]

Share this post


Link to post
Share on other sites
For music you can use DirectShow and for short sound effects DirectSound.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!