0
0

Hey I’m knew to using FMOD. I can get it to play an mp3 if I play it and the Sleep until the song is over. But I want to just call a function that starts playing it and then go on with my program. This doesn’t seem to work. It only plays the first part of the song as in less than a second.

void Play()
{
int firsttime;
FSOUND_DSPUNIT *DrySFXUnit = NULL;
int channel = FSOUND_FREE;

if (channel == FSOUND_FREE)

{
firsttime = TRUE;
}
else
{
firsttime = FALSE;
}

FSOUND_SetBufferSize(100);  
if (!FSOUND_Init(44100, 32, FSOUND_INIT_ENABLEOUTPUTFX))
{
}

FSOUND_STREAM * song = FSOUND_Stream_Open(fname, FSOUND_HW2D, 0, 0);
if (!song)
{
}

int         echoid = -1, echoid2 = -1,flangeid = -1;

FSOUND_Stream_SetMode(song, FSOUND_LOOP_OFF);

channel = FSOUND_Stream_Play(FSOUND_FREE, song);
FSOUND_SetPaused(channel, FALSE);

}

Anyone know what’s wrong?

  • You must to post comments
Showing 0 results
Your Answer

Please first to submit.