Thread: Playing Music

  1. #1
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644

    Playing Music

    I'm pretty sure this has been asked before....but here's my question. How do I play a *.wav file while the user is playing my game. I've gone to www.gametutorials.com and downloaded the right (Dev-C++ port) tutorials that where available, but none worked. And yes, I'm using Dev-C++, if anyone can help me, or anything, please.

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Yes it has been asked many times before. But here's a link:

    http://www.codeguru.com/multimedia/play_wav.shtml

    [EDIT]
    Sorry, I see it's the DOS board. Here you can find a description of wave-files.

    http://www.wotsit.org/
    [/EDIT]

  3. #3
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Thanks. That helped me alot. Now to get the file to play.

  4. #4
    Registered User
    Join Date
    Apr 2002
    Posts
    129
    I know Bubba did some stuff with the sound card, maybe pm him about it.

  5. #5
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Who is Bubba??? Sorry, but these are my great newbie powers.......

  6. #6
    Registered User Sunny's Avatar
    Join Date
    Nov 2001
    Posts
    101

    greetz

    Bubba definetely knows something about that. On the ohter hand, a little trick used by many game programmers is using audio cds mixed with data cds. If you have any mp3s of the music you want to play, you can burn them to a cd, but leave the first track as data ( Like maps, characters, images ). Like this, you don't have to worry about memory maanagement and all sorts of stuff. Anwy, it's only a suggestion.


    Stef


    Learn more about the XBlue shell and how you can make this world a better place:
    http://www.angelfire.com/my/bahairomania/freegui.html
    e-mail me about it.

  7. #7
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    That won't work because it ain't a MP3 and won't be a MP3 (a lot of space it takes up).....I tried the fmod deal with the mod/midi type but that won't work

  8. #8
    Registered User
    Join Date
    Apr 2002
    Posts
    11
    Qauz... I tried to download your new RPG but the link's broken it seems.

  9. #9
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    Geocities is being a idiot right now......have u tried downloading my new version from my site?

  10. #10
    Registered User
    Join Date
    Apr 2002
    Posts
    11
    I tried downloading both off the download page any neither link works. But I downloaded the one posted on the news page, and found two bugs within five minutes hehe.

  11. #11
    I am the worst best coder Quantrizi's Avatar
    Join Date
    Mar 2002
    Posts
    644
    If you d/l the 43 kb file, you should read the stuff.txt file

  12. #12
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Who is Bubba?



    Go here and download the sound card programming doc from Creative Labs.

    http://developer.creative.com/LEFTME..._Downloads.asp

    Click on the legacy development tools.



    Go here to see some source code. Ethan Brodsky's source code did not work on my system w/o some alterations. If you follow the Creative doc it will work.

    http://www.cae.wisc.edu/~brodskye//


    Unfortunately my code has been deleted by some force of nature so I'm currently re-writing it in DJGPP. DA was the last one to have my code.

    Incidentally I figured out how to get around the interrupt problem in real mode. Simply set a flag that tells the sound system, hey knucklehead it's time to load more data. Then outside of the interrupt handler, a function would check that flag and reload if necessary.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Is AOL music crazy?
    By joeprogrammer in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 03-24-2006, 07:24 PM
  2. Playing music
    By adr in forum Windows Programming
    Replies: 13
    Last Post: 12-31-2005, 03:23 PM
  3. playing music in C++
    By dutch's finest in forum C++ Programming
    Replies: 3
    Last Post: 02-21-2005, 05:57 PM
  4. Playing music
    By PJYelton in forum Windows Programming
    Replies: 5
    Last Post: 06-25-2003, 09:09 AM
  5. Playing Music in C#
    By Smoose777 in forum C# Programming
    Replies: 9
    Last Post: 06-06-2002, 04:11 PM