How to make sound?

This is a discussion on How to make sound? within the Game Programming forums, part of the General Programming Boards category; I tried using FMOD but for some reason I just can't get it to work right. I gone through their ...

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    28

    How to make sound?

    I tried using FMOD but for some reason I just can't get it to work right. I gone through their "getting started" help file but that didn't help.

    I get compiler errors. Either I'm not doing something right in the code or I'm not linking something or adding some library. Problem is that I'm new enough that I don't know the actual question to ask, like am I suppose to have some kind of library link (and how do you link it) and stuff. I don't really want to use FMOD because I plan on selling my game when it's completed and I don't want to pay a fee.

    Does anyone have a function that will play sound effect and ambient background sound? I looked for Bubba's complete sound source but can't find it. My ideal thing is having a background sound, like birds chirping in a forest and while you are in combat, you can hear swords clashing. This is a console application.

    I've looked online and can't find anything helpful. Not even if I tried using FMOD. PlaySound only plays one sound at a time.

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    I looked for Bubba's complete sound source but can't find it.
    My old sound source was for DOS and the other was for DirectMusic. Both of those are deprecated to say the least. I'm now using OpenAL and posting the source would do little since it is quite simple to get OpenAL up and running.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    28
    I'll try that and see how it goes. I just couldn't get FMOD to work at all. Kept getting compiler errors.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,531
    Well saying what compiler you're using, and posting some ACTUAL error messages might help...
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Sep 2008
    Posts
    28
    I'm using VC express. I think it's 2008. It's the free one.

    As far as the errors go, I didn't write them down. I'm currently on a business trip and I am using a different computer to access the internet than the one I have my code on. It's a bit of a hassle right now. Things will be better once I get back home next week.

    But the whole FMOD was a bit frustrating. I couldn't find any instructions other than the one it came with that would show step by step how to make it work. Or even sample code that included everything that needs to be in it, like the headers (#include) and stuff. I find it easy to dissect a code. But there is none to dissect fully.

  6. #6
    Intranasal Heroin User Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,035
    You can try using mcisendstring() if you're feeling lazy.
    Code:
    mciSendString("play sound.wav", NULL, 0, 0);

  7. #7
    Registered User
    Join Date
    Sep 2008
    Posts
    28
    Quote Originally Posted by Xterria View Post
    You can try using mcisendstring() if you're feeling lazy.
    Code:
    mciSendString("play sound.wav", NULL, 0, 0);
    mciSendString seems to be able to play multiple sounds at once. I'm having trouble getting the repeat command to work. I'm trying:

    mciSendString("play sound.wav repeat", NULL, 0, 0);

    but it doesn't seem to work. I go to the following site play (Windows) but the usage is hard for me to understand.

  8. #8
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Closed. Please do not bump old threads.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error with Make File
    By niranjanvg in forum C Programming
    Replies: 0
    Last Post: 04-06-2010, 08:20 AM
  2. make with debug options
    By Andaluz in forum Linux Programming
    Replies: 4
    Last Post: 01-19-2010, 09:24 AM
  3. Using PC Speaker and NOT the sound card in a console...
    By Trauts in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 04-09-2003, 08:52 PM
  4. how to make files
    By quiksilver9531 in forum C++ Programming
    Replies: 6
    Last Post: 02-22-2002, 05:44 PM
  5. Sound?
    By Kavity in forum C++ Programming
    Replies: 5
    Last Post: 01-01-2002, 12:45 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21