0
0

I’m remaking my Pong game from last year and now I’m up to the sound part of it. Lemme give you my source code first:

[code:30wa9y3o]
"CEngine.h"
class CEngine
{
public:
...
FSOUND_SAMPLE *bounce; // The bounce sound
...
};

"CEngine.cpp"
...
// Load the bounce sound
FSOUND_Sample_Load(0, "data/bounce.wav", FSOUND_LOOP_OFF, 0, 0);
...

"Main.cpp"

...
if (Engine.keys[SDLK_SPACE])
{FSOUND_PlaySound(FSOUND_ALL, Engine.bounce);}
...
[/code:30wa9y3o]

Whenever I push the spacebar, the game crashes. What’s wrong here?

  • You must to post comments
0
0

did you initialise fsound (use fsound_load then fsound_init)?

  • You must to post comments
0
0

Yes I did;

// Initialize FMOD
FSOUND_Init(44100, 32, 0);
  • You must to post comments
0
0

[code:19gvhzq4]
bounce = FSOUND_Sample_Load(0, "data/bounce.wav", FSOUND_LOOP_OFF, 0, 0);
[/code:19gvhzq4]

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.