0
0

I’m having trouble playing the samples in an fsb file. It correctly reads the number of samples, but it won’t play anything. I’ve tried setting the volume on the channel, and still couldn’t get sound. Any suggestions?

void main()
{
FMUSIC_MODULE* bank = 0;
FSOUND_SAMPLE sptr;
const char
name;
name = “C:\fmodapi363win32\fmodapi363win32\tools\Will.fsb”;

if (!FSOUND_Init(44000, 64, 0))
{
    printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
    exit(1);
}


bank = FMUSIC_LoadSong(name);
if (!bank)
{
    printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
    //exit(1);
}

cout<<FMUSIC_GetNumSamples(bank)<<" Samples in Sound Bank"<<endl;

sptr = FMUSIC_GetSample(bank,0);

if (!sptr)
{
    printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
    //exit(1);
}
else
    FSOUND_PlaySound(FSOUND_FREE,sptr);




if (!FMUSIC_PlaySong(bank))
{
    printf("%s\n", FMOD_ErrorString(FSOUND_GetError()));
    //exit(1);
}


FSOUND_Sample_Free(sptr);
//FMUSIC_FreeSong(bank);

FSOUND_Close();

}

  • You must to post comments
0
0

Never mind, I found the problem 😳

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.