+ Reply to Thread
Results 1 to 18 of 18

Thread: Mp3

  1. #1
    Senior Member
    Join Date
    Jul 2004
    Location
    Isle of Wight, UK
    Posts
    3,773

    Default Mp3

    What's the best to play an MP3 file on PC ?

    I used to use mciSendString() but that now fails when opening the file with Err:266 (Driver couldn't load).

    It used to work just fine until I upgraded my DX9 SDK from an '07 build to August 08 and switched to using XAudio2 for sound effects instead of the apalling DirectSound API.

    Confused - media player still works just fine!
    Regards,
    Paul Johnson

    [Great BIG War Game: iOS | Android] [Great Little War Game: iOS | Android] [Fruit Blitz: iOS | Android] [Yachty Deluxe: iOS | Android]

  2. #2
    Senior Member
    Join Date
    May 2005
    Location
    Warsaw, Poland
    Posts
    2,707

    Default

    Why dont you use OGG instead? The libraries are very easy to integrate (wont take more than a couple of hours to make them use your sound code, less if you don't actually have sound code in there and you just want to play the music) and there wont be any dependency on the system to have the proper coders/drivers/whatever (see what happened to System Shock 2's videos for depending on windows to have the codec forever). And as a bonus you get slightly better quality (although on higher bitrates you'll hardly find any difference).

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Location
    Isle of Wight, UK
    Posts
    3,773

    Default

    OGG support has been on my todo list for some time actually, just never seem to get around to it.

    I'll definitely get it done one day. One thing that worries me a little - can it be made to run on 360 ?
    Regards,
    Paul Johnson

    [Great BIG War Game: iOS | Android] [Great Little War Game: iOS | Android] [Fruit Blitz: iOS | Android] [Yachty Deluxe: iOS | Android]

  4. #4
    Administrator
    Join Date
    Aug 2004
    Location
    California
    Posts
    1,769

    Default

    Yes. Ogg can work on the 360.

    Every game I have worked on has uses OGG Vorbis for audio compression including the Xbox, Xbox 360, Mac, Windows, and Wii versions.

    Avoid MP3 if you can. But if you must use it them use a library that has paid for an MP3 license such as MilesSoundSystem.
    James C. Smith - Producer/Lead Programmer - Costume Chaos, Build in Time, Ricochet Infinity, Big Kahuna Reef, CasualCharts.com

  5. #5
    Senior Member
    Join Date
    Jul 2004
    Location
    Isle of Wight, UK
    Posts
    3,773

    Default

    Sold! OGG goes up the to-do list.

    Thanks James.
    Regards,
    Paul Johnson

    [Great BIG War Game: iOS | Android] [Great Little War Game: iOS | Android] [Fruit Blitz: iOS | Android] [Yachty Deluxe: iOS | Android]

  6. #6
    Senior Member
    Join Date
    Feb 2005
    Posts
    2,070

    Default

    Another vote for OGG.

    Also, if you use VBR-OGG (Variable Bit-Rate), the resulting file is tiny compared to its MP3 equivalent with no distinguishable loss in sound quality.

  7. #7
    Senior Member
    Join Date
    Jun 2007
    Location
    Singapore
    Posts
    203

    Default

    Yup, I use OGG for all my game audio files. MP3 is only for my iPod touch.
    My irregularly updated blog
    Try out my latest iPhone game Piecehunters

  8. #8
    Senior Member
    Join Date
    Sep 2005
    Posts
    154

    Default

    I use Bass to play both OGG and MP3 on the PC. The good news is that the Bass library comes with a DLL that uses windows to decode the MP3 so you don't have to buy an MP3 license. I use OGG for all my own sounds, but let the user play their own MP3's.

    Good luck,

    -Jeremy
    Zenix3D, because sometimes you just wanna blow stuff up!

  9. #9

    Default

    Quote Originally Posted by Applewood View Post
    Sold! OGG goes up the to-do list.

    I personally prefer the OGG results on an audio file than his mp3 equivalent. It's more flexible, less prone to distortion and more accurate in its spectrum.

  10. #10
    Junior Member
    Join Date
    Oct 2008
    Posts
    13

    Default

    wav is ideal if you've got the space, plus it's more easily modded than ogg. but mp3 is good (though it tends to be muffled), ogg is ok but the encoding is unusual, wma also very good. any format that you can play in a standard computer media player would be a thought, so that people can listen to the music/sfx seperately to the game, which is something i like to do.
    in this era of modding, wav and mp3 are ideal cause they're the format most readily converted to with free tools that come with most operating systems that gamers will have free access to.

    i'd agree that ogg's more stable with higher quality and better all round for unchangable content, but overprotecting your files is counterproductive to the longevity of your game, and ogg is probably the hardest to replace apart from fully embedded media.

  11. #11
    Senior Member
    Join Date
    Aug 2005
    Posts
    242

    Default

    Doesn't mp3 use require a license for commercial use? I've never really looked into this, but always assumed that was one of the reasons several companies used OGG instead.

    All that aside, I prefer OGG as it's a free open standard, both my portable "mp3" players support it and it's what I have all my music encoded as. Quality wise, I'm not an audio guy, but it's certainly good enough for my ears It's also the format used in a few of the games I've worked on.

  12. #12
    Senior Member
    Join Date
    May 2007
    Location
    Los Angeles, CA
    Posts
    293

    Default

    Yes, MP3 requires a license to sell an mp3 decoder or to supply a decoder in a commercial project.

    Last time I checked, it was only applicable to projects which sold over 5,000 units OR were distributed for free at least some tens of thousands of times.

    It can be used for low distribution, non-commercial projects.

    Ogg is not any more difficult to "edit" than an MP3, frankly, Matt, and if I were to suggest an uncompressed filetype, I'd go with PCM.

    If you're afraid of editing an Ogg file, for some reason, there's always MP2?? It's streamable... compressed... I guess.

    EDIT: Oh yes, stay away from WMA, seriously.
    - Dan

    Composer

  13. #13
    Senior Member
    Join Date
    Jan 2007
    Location
    NYC
    Posts
    486

    Default

    Ah, if only OGG would work in Flash.... maybe with Flash 10 someone can use the new low-level sound routines to write a decoder.

    - andrew

  14. #14
    Senior Member
    Join Date
    May 2007
    Location
    Los Angeles, CA
    Posts
    293

    Default

    That would rock, Andrew.
    - Dan

    Composer

  15. #15
    Senior Member
    Join Date
    May 2005
    Location
    Warsaw, Poland
    Posts
    2,707

    Default

    done :-P and its in haXe too :-)
    More info here.

    I'm also thinking to write a vorbis decoder in order to use vorbis-encoded samples in my MOD player.

  16. #16
    Senior Member
    Join Date
    May 2007
    Location
    Los Angeles, CA
    Posts
    293

    Default

    Bad Sector, that's pretty rad, but there needs to be some kind of load estimation protocol to avoid my 5 seconds of Max Hedroom music!
    - Dan

    Composer

  17. #17
    Senior Member
    Join Date
    May 2005
    Location
    Warsaw, Poland
    Posts
    2,707

    Default

    Hm? Not sure what you mean.

    Note that i didn't made this, some guy from the haXe mailing list did.

  18. #18

    Default

    Quote Originally Posted by Gary Preston View Post
    Doesn't mp3 use require a license for commercial use? I've never really looked into this, but always assumed that was one of the reasons several companies used OGG instead.
    Windows comes with an MP3 decoder so, if you're only worried about Windows, you don't need to license it yourself.

    Also, to answer the original question (late, I know), a relatively easy way to play an MP3 in Windows is using the DirectShow APIs. There's an article in MSDN "How To Play A File" which spells it out pretty clearly with sample code. Heck I'll even give a link:

    http://msdn.microsoft.com/en-us/libr...87(VS.85).aspx

    To my knowledge DirectShow is not supported on the 360 so you're out of luck there.

    Geoff

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts