Author Topic: FMOD Help  (Read 1684 times)

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.132 Chrome 43.0.2357.132
    • View Profile
  • Playstyle: Keyboard
FMOD Help
« on: July 12, 2015, 10:21:33 AM »
I'm not trying to absolutely rewrite the game's sound system to FMOD, but instead just use it to play some specific sounds. No matter what I try, though, it won't play the sound when I try to get it to. Here's the steps I use:

Make a new object similar to the Seph Engine's FMOD loader.
Initialize FMOD correctly.
Add the sound with the SoundAdd function, correct directory and all.
Now switching to the World object.
In End Step Event, I use the FMODUpdate function.

Now I play the sound through a different object, like the player object. It doesn't play. I know it's something with the specific sound and not with FMOD, because when I do it in the Seph Engine which already has everything done, and I add the sound and play it, it doesn't play. Can anyone help me out here?

Another thing to add, I'm taking the sound effects from the K3 sound effects folder. The sounds don't load in Audacity and they can't be converted with an online converter, so I'm wondering if this changes anything.
(click to show/hide)

smoke weed everyday

klazen108

  • Administrator
  • The Kid
  • Posts: 286
  • your a kid now your a squid now
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 43.0.2357.132 Chrome 43.0.2357.132
    • View Profile
    • Delicious-Fruit
  • Playstyle: Keyboard
Re: FMOD Help
« Reply #1 on: July 12, 2015, 11:49:14 AM »
You might need to get the correct codec if audacity won't open the file, but then that leads to the question of what format are these files in? Go get this and try again: K-Lite Codec Pack If you still can't open the file after that, then it's probably a protected file. Or maybe it's a sign that you shouldn't be using K3 sound effects in your game :MVGame:

It's also possible that you missed something in the code. You mention that you tried this in a clean version of the Seph engine - do the other sound effects work correctly even if you copy them somewhere else? What about loading a completely different sound, one not from the K3 files, does that one work? Just for reference:

1) Once, on game start, you load the sound into a global variable:
Code: [Select]
global.sndPlayerJump = FMODSoundAdd("sfx/sndPlayerJump.wav",false,false);This takes a file in the sfx directory named sndPlayerJump.wav (make sure everything matches, idk if it's case sensitive but better safe than sorry) - and leave the two false values as-is, they specify 3D/Streaming capabilities which you won't need for this. (Although streaming is nice for BGM - keeps the huge files out of memory and loads instantly on startup)

2) When you want to play the sound, pass in the global variable you created:
Code: [Select]
FMODSoundPlay(global.sndPlayerJump);And that's all there is to it.

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 43.0.2357.132 Chrome 43.0.2357.132
    • View Profile
  • Playstyle: Keyboard
Re: FMOD Help
« Reply #2 on: July 12, 2015, 01:07:24 PM »
what format are these files in?
.wav format. probably an odd wav format, though, since other ones work just fine. might go full circle back to K3 sounds being fucky wackos :Kappa:

It's also possible that you missed something in the code. You mention that you tried this in a clean version of the Seph engine - do the other sound effects work correctly even if you copy them somewhere else? What about loading a completely different sound, one not from the K3 files, does that one work?

Moved the working sounds to a different directory, those sounds still played. I used a different sound that worked in regular gamemaker sound functions, and it worked as well.

1) Once, on game start, you load the sound into a global variable:
Code: [Select]
global.sndPlayerJump = FMODSoundAdd("sfx/sndPlayerJump.wav",false,false);This takes a file in the sfx directory named sndPlayerJump.wav (make sure everything matches, idk if it's case sensitive but better safe than sorry) - and leave the two false values as-is, they specify 3D/Streaming capabilities which you won't need for this. (Although streaming is nice for BGM - keeps the huge files out of memory and loads instantly on startup)

2) When you want to play the sound, pass in the global variable you created:
Code: [Select]
FMODSoundPlay(global.sndPlayerJump);And that's all there is to it.

Did exactly that.

I'm guessing that the conclusion is that I shouldn't take sound files from K3. Damn.
(click to show/hide)

smoke weed everyday