0
0

I’m really new to fmod and I’m trying to write a simple windows program to play an mp3 file. When I try to run the program I get no sound. I was wondering if anyone has a simple program like this or knew where I could find one.

thanx 😮

  • You must to post comments
0
0

oh yeah I forgot to mention that I made the program on vc++ for Win32.

  • You must to post comments
0
0

yeah, but is it really neccesary to use callbacks to laod and play a stream. All I did was FSOUND_Init, FSOUND_Stream_Load, then FSOUND_Stream_Play.

  • You must to post comments
0
0

Well see, that is all I have in my program and yet I get no sound.

Here is what my code currently looks like:

//Global
FSOUND_STREAM *stream

int Game_Init(void *parms)
{
// this function is where you do all the initialization
// for your game

int channel = 0;

// start up DirectDraw (replace the parms as you desire)
DDraw_Init(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_BPP, WINDOWED_APP);

// initialize directinput
DInput_Init();

// acquire the keyboard
DInput_Init_Keyboard();

// add calls to acquire other directinput devices here…

//initialize the fmod api
FSOUND_Init(44100, 32, FSOUND_INIT_GLOBALFOCUS))

//load the song (SONG is a #define for the name of the song)
stream = FSOUND_Stream_Open(SONG, FSOUND_NORMAL | FSOUND_2D | FSOUND_LOOP_NORMAL, 0, 0);

//play the song
channel = FSOUND_Stream_Play(FSOUND_FREE, stream);

// hide the mouse
if (!WINDOWED_APP)
ShowCursor(FALSE);

// seed random number generator
srand(Start_Clock());

// return success
return(1);

} // end Game_Init

  • You must to post comments
0
0

excellent! I got it to play!

It was the path given to the SONG define that made the
diference. 😀

I appreciate the help, thanx.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.