locked
Playing mp3 sound file RRS feed

  • Question

  • Well I am designing a Game Engine. My Graphics Engine (using Directx 11) is almost completed. My next task on my list is building a Sound engine. So could you tell a good platform for sound engine development which can probably play an mp3 file as well as modulation of the sound file like changing frequency,loudness,speed,etc. It would be also great if you could provide me any website links for its samples,tutorials and documentation.
    Friday, May 6, 2011 1:56 PM

Answers

  • Well, since you said you are using DirectX 11, you will have access to all of the DirectX audio documentation.

    The DirectX SDK has all the documentation for XACT, XAudio2, X3DAudio, XAPO, XAPOFX, and good old DirectSound. But well, thats the Microsoft documentation and tutorials mentioned.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
    Visit my (not very good) blog at
    http://ccprogramming.wordpress.com/
    Friday, May 6, 2011 3:12 PM

All replies

  • Well, since you said you are using DirectX 11, you will have access to all of the DirectX audio documentation.

    The DirectX SDK has all the documentation for XACT, XAudio2, X3DAudio, XAPO, XAPOFX, and good old DirectSound. But well, thats the Microsoft documentation and tutorials mentioned.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
    Visit my (not very good) blog at
    http://ccprogramming.wordpress.com/
    Friday, May 6, 2011 3:12 PM
  • Well i have given an overview to DirectX documentations  for XACT, XAudio2, X3DAudio, XAPO, XAPOFX, DirectSound. Ill give them a try. Can you suggest a name of any one of them powerfull and simple and easier to understand.
    Friday, May 6, 2011 3:43 PM
  • Could you also tell me which one of these:XACT, XAudio2, X3DAudio, XAPO, XAPOFX, and DirectSound supports mp3 playback
    Friday, May 6, 2011 3:46 PM
  • None of the DirectX audio directly support MP3. This isn't to say it is not possible, it just means you have to decompress the mp3 files yourself. This leads to the problem that if you put this into a commercial product then you may have to pay the license fee for writing an mp3 decoder.

    Anyway, XAudio2 is the current one that Microsoft are pushing at game developers. Looking at the documentation for it seems pretty straight forward.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
    Visit my (not very good) blog at
    http://ccprogramming.wordpress.com/
    Friday, May 6, 2011 4:23 PM
  • Wow, I didnt understand the license part. Do you mean to say by decoding mp3 file in my software for sale Ill have register a copyright license for my software. Is that what you mean?
    Friday, May 6, 2011 5:23 PM
  • No, mp3 is patented in the USA. That means you have to pay a fee to the patent holder to be allowed to write an mp3 decoder and distribute it in any countries which allow software patenting and mp3 is patented in. See this for more information.

    This is one of the biggest reasons game developers tend to stay away from mp3 (sticking with either raw pcm or open source formats). The patent issue is also why there is so many people against h264 as the defacto HTML5 video format, they want the internet to be free and open. If like me you live in a country that doesn't allow software patenting it is easy to ignore or forget, but if you are writing software do distribute in some shape or form globally, then things are different.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.
    Visit my (not very good) blog at
    http://ccprogramming.wordpress.com/

    Friday, May 6, 2011 5:40 PM
  • Thanks for the Information. You opened my eyes now will stick with wav and wma formats and forget mp3.
    Saturday, May 7, 2011 5:11 PM
  • @Vegan Fanatic: Okay Ill give it a try as well and then choose the most suited, Thanks
    Sunday, May 8, 2011 9:11 AM