XNA Creators Club Online
Page 1 of 2 (26 items) 1 2 Next >
Sort Posts: Previous Next

Real MP3 Support for XNA (WINDOWS & XBOX360)

Last post 3/10/2009 7:37 PM by Harald Maassen. 25 replies.
  • 12/11/2007 4:12 PM

    Real MP3 Support for XNA (WINDOWS & XBOX360)

    Hello Guys!

    As most of you already know, XNA has a really bad support for playing musics and sounds.

    This is because that XNA is limited to play wav-files in PCM format, which isnt compressed.

    The result is that your project ends up with giant wav-files. For Example 2 Soundtracks and a few other game sounds are around 300Megabyte. - THAT IS TOO BIG FOR 2 SONGS AND A FEW SOUNDS!

    Its completely unhuman to have such big files in a project folder or included in a downloadable version of a game.

    As I know, Microsoft is really friendly about user made suggestions and petitions they get from their communities.

    I think they only need to get the point, that there are a lot of users who really need that feature.

    I have started a suggestion on microsoft connect for this missing feature.

    PLEASE, please think a moment about it and take the time to vote for this important feature request.

    You should find the connect suggestion here:

    https://connect.microsoft.com/feedback/ViewFeedback.aspx?FeedbackID=316891&SiteID=226

    Or with the searching for mp3 on the Microsoft Connect page for XNA.

  • 12/11/2007 4:26 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Compression can be turned on in XACT. http://blogs.msdn.com/mitchw/archive/2007/04/27/audio-compression-using-xact.aspx. On the xbox it uses some WMA variant which usually gives you files about 25% the size of the originals. Windows uses ADPCM which is not so good but will still save space.

    For Microsoft to include an MP3 decoder they would have to pay for a license even if they chose to do it. Would you be prepared to pay extra in your CC membership for that?

     

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 12/11/2007 4:32 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Also consider that decompressing an audio file is going to cost you some CPU, if you consider that a big bad wave file isn't so scary now is it?  Look into using mono for background music if possible, it can halve the file size.
  • 12/11/2007 4:33 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Even if the users of XNA would have to pay (i think it is unrealistic) it is important to have such a feature at least for a good game development tool. WMA or anything relative to mp3, OGG would be cool too.

  • 12/11/2007 4:34 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Mono sound halves the size, yes. But do you really want mono? Do you want to have low quality sounds? games?

    - NO.

  • 12/11/2007 4:35 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    As ZMan pointed out, XACT already supports compression, at least once you figure out how to turn that on (it isn't exactly obvious in the UI :-)
    XNA Framework Developer - blog - homepage
  • 12/11/2007 4:37 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    >(it isn't exactly obvious in the UI :-)

    And the XACT help file is so incredible that it makes the managed directx documentation look like War and Peace... go on check out the 'help' menu in Xact if you want a good laugh...

     

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 12/11/2007 6:04 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    I can't say that I've used XACT all that much, but the few times I have used it I got the strong feeling of it being an unfinished product, like a technology preview version or a pre-beta.

    I do agree that some more compression options on Windows would be good.  How many modern games use uncompressed sounds for performance reasons or are bottlenecked by OGG decompression?

    Microsoft DirectX/XNA MVP
  • 12/11/2007 6:09 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    The ZMan [MVP/Moderator]:
    go on check out the 'help' menu in Xact if you want a good laugh...

    I have found the help quite useful since different versions of Xact are not compatible with each other. The version you're using if you have multiple installed is good to know!

     

    How about .wma? Is it possible to play that?

    • Quality and compression is good
    • No excuses about licensing fees! ;-)
    • Definately works on 360
  • 12/11/2007 7:18 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    There is no help file linked from the help menu, there is no help file installed with GSE....

    In fact I was under the impression that there was very little help for XACT at all other than the GSE tutorials but i looked in the obvious place and there it is... http://msdn2.microsoft.com/en-us/library/bb943865.aspx (or in the similar place in the DirectX SDK MSI of course)

    I take back my sarcasm on the subject.... I have no idea how I have missed this before...

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 12/11/2007 7:21 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Stanlo:

    How about .wma? Is it possible to play that?

    • Quality and compression is good
    • No excuses about licensing fees! ;-)
    • Definately works on 360

    If you turn on compression in XACT then on the 360 you are using XMA which is (or is very similar to) WMA..

    I believe the reason WMA is not enabled in XACT on windows is that its too CPU intensive to decode - or was when Xact first came out. See this thread from the old forums https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=250095&SiteID=1

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 12/11/2007 8:01 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    How about Ogg Vorbis support then? No licensing issues there as it is open source, and widely used in the gaming industy (for example, Epic Games uses it in Unreal Tournament).

    From their FAQ:
    Vorbis saves developers money by avoiding patent-license fees.
  • 12/11/2007 8:12 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Add a connect issue... asking in here probably won't achieve much.

     

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 12/11/2007 8:18 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Mindless bickering, while perhaps unproductive, is much more fun than sending a request on it's way and forgetting about it.
  • 12/12/2007 12:28 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Support for additional audio formats is a known request and one we're tracking.

    RE: How to enable compression in XACT, I've found this article useful:

    http://blogs.msdn.com/mitchw/archive/2007/04/27/audio-compression-using-xact.aspx

    :)

    Mitch Walker
    Program Manager - XNA Game Studio
  • 12/12/2007 1:36 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    25% of the original size is decent, but still presents a size problem, especially for downloadable games. 300MB of sound compressed to 75MB is good, but might still be too big for downloading. This link: http://grahammitchell.com/writings/vorbis_intro.html claims compression ratios with ogg format of 5% of original size are possible, but even 10% would be great.

    I think the solution to the sound issue is to provide the ability to have direct access to sound buffers. That way ANYONE could write the code to decode an ogg file or wma file or a zipped wav file for that matter and stuff it into the sound buffer appropriately. The sound could be streamed in from a file or memory easily once the sound buffer API was available.

    It would also be a bonus if the XNA team implemented the sound buffer code to decode ogg and/or wma, but even if they didn't at least the community could eventually write it.

    Either way, I think having a second option besides XACT would be a big plus. Right now I use irrKlang for my windows sound API, and for XBOX I still use XACT. My CPU usage percent maybe increased by a percent or two when playing an ogg file from disk with irrKlang... Managing the code for two sound API's is a small chore, but the real time consumer is managing two sets of content.

    Even if the only thing the XNA team provided in the API was the ability to play a WAV file from a stream, that might be sufficient short term, because the game could zip it's content, and then unzip it at install time.

    Finally, I know the XNA team has been working hard to get lots of cool features into the product, which we all sure do appreciate, however I know this is one of the top connect issues, so here's hoping it gets high (or top) priority starting in 2008.

  • 12/12/2007 2:28 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    If you want to play MP3 and ogg vobis sound files, you can use the FMOD Library.  The PC library is free, and they do have an XBOX library as well (but I'm not sure if that one is free.)
    For an example of how to use it, I've written a game component that wraps up using FMOD to play background music and sounds.
    The GameComponent is here:
    http://svn.projectxenocide.com/xenocide/xna/trunk/Dependancies/FMOD

    Basic steps to use it are:
    1. Include reference to component in your project.
    2. In your Game derived class, register the component
    Components.Add(new AudioSystem.FmodGameComponent(this));
    3. In the directory where your game executable is, create the subdirectory Content\Audio\Music.
    4. Copy the files you want to play to this directory.
    5. Call the GameComponent's PlayRandomMusic() to play the files in shuffle mode.
    6. Note, if you have different background music themes you want to play at different times, Put them in subdirectories under Content\Audio\Music, and call PalyRadomMusic() with the subdirectory names.

    Side note, I gave the GameComonent code a Creative Commons license.  However, if that's a problem, let me know and I'll happily change it to zgip, microsoft permissive, or anything like that.
    Note, I use this game component in Xenocide, http://svn.projectxenocide.com/xenocide/xna, so if you hunt around for AudioSystem, you should see how it all works.

  • 12/12/2007 3:23 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    The Xbox library for FMOD is either native (in which case it is not available for use with XNA) or a .NET wrapper around a native library (still not available for XNA use). But definitely utilize FMOD on the PC if you wish. I've had a bit of experience with it in native C++ and it's a nice library.
  • 1/15/2008 10:57 AM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Yes, because this feature is essential!
  • 1/15/2008 11:35 AM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    If its 'essential' then how has anyone managed to write any games with XNA so far?

    You need to provide a more substantial justification before throwing around words like essential. For examples MP3s can easily be turned into WAV files and compressed with XACT. Why is that not good enough.

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 1/17/2008 8:34 AM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    You are right. I found this old thread by searching for mp3 and wanted to answer to a reply obove. But anyway...

    Playing mp3s is essential for our team because our windows game is using a build in music player. If you buy a record at I-Tunes u will dl a mp3 file. I dont think that converting every single mp3 to wav would make sense.

    If you think about sound effects --> static content --> mp3 support is not essential. However if you have dynamic content like changing sound files it would be awesome to have mp3 support.

    I would not mind if I had to pay for licence fees.

  • 1/17/2008 8:56 AM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

  • 1/17/2008 9:38 AM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Really?! ;-) Did you read the whole thread?
  • 1/17/2008 2:27 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    As I said in my earlier post, you can use the FMOD library to play MP3s on Windows.

  • 3/10/2009 7:28 PM In reply to

    Re: Real MP3 Support for XNA (WINDOWS & XBOX360)

    Anyone have any thoughts about .FLAC? 

    I'd like to see it, but I suspect that demand wouldn't be terribly large for something like that. 
Page 1 of 2 (26 items) 1 2 Next > Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG