I’m making a sound wrapper for a game I’m working on and I’m using FMOD. I’ve run into a number of problems recently that are odd to say the least. Let me preface what I’m about to write by saying that I have only been programming for about 8 months now so I’m still sort of new but I feel like a have a decent grasp of C++. Also, this is only the second time I’ve ever written code for sound. Basically me and some classmates are making an outer space dogfighting game like X-Wing v. Tie-Fighter or Descent: Freespace. The player is basically going to be at the same position as the camera and fly around space blowing up other ships. I want to have positional audio in the game so I’m going to use the built in 3D functions that FMOD provides. I can use the position data from the player’s camera for the FSOUND_3D_Listener_SetAttributes function call and I can use the positions of all of the enemy ships to base all of their sound positions off of. Here’s the part I don’t understand, in the documentation it states that you must pass the FSOUND_3D_SetAttributes function the channel that you are playing a 3D sound on. I’m assuming that FSOUND_3D_SetAttributes is what I would use to update the positions of all of the other ship sounds in the game as they relate to the player’s position. Here’s what I’m thinking: I should set the player’s positon (the camera’s coordinates) with the FSOUND_3D_Listener_SetAttributes function, then if I need to play a 3D sound I would set the attributes of the channel that the sound was loaded into using FSOUND_3D_SetAttributes and then play the sound. The problem is, if I try to load sounds up to specific channels so that I know which channel each different sound is in then the program won’t run. I tried loading up 3 .wav files into 3 different channels and the program wouldn’t run. It was breaking right when I loaded the third sound even though I was loading each .wav file into a seperate channel. Am I doing something wrong here or is my logic off? I’m thinking that I’m not completely grasping exactly how channels work on a sound card. Is there an easier way to do this that anybody can think of? Please post any help you can give me.

Note: Only one cookie per username :)

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.