0
0

[code:35jfc2qo]FMOD_Sound_SetMode(mySound, FMOD_LOOP_NORMAL);[/code:35jfc2qo]

I use the above line to have a sound loop but it’s not working correctly. It doesn’t finish playing the entire sound effect before starting the next loop.

  • You must to post comments
0
0

Check where the loop parts in the sound using FMOD_Sound_GetLoopPoints.

  • You must to post comments
0
0

Ok, weird. I did this to manually set the loop points to the end of the track.

[code:1s3eqoy6]unsigned int length = 0;
FMOD_Sound_GetLength(m_fsSoundEffect, &sound_length, FMOD_TIMEUNIT_MS);
FMOD_Sound_SetLoopPoints(mySound, 0, FMOD_TIMEUNIT_MS, length, FMOD_TIMEUNIT_MS);[/code:1s3eqoy6]

Now it loops over the correct interval but the last part of the track isn’t playing.

I’m loading the sound like this.
[code:1s3eqoy6]FMOD_CREATESOUNDEXINFO info;
memset(&info, 0, sizeof(FMOD_CREATESOUNDEXINFO));
info.cbsize = sizeof(FMOD_CREATESOUNDEXINFO);
info.length = size;

FMOD_System_CreateSound(FmodSystem, (char *)data, FMOD_OPENMEMORY, &info, &mySound);[/code:1s3eqoy6]

I’m porting this from FMOD 3 where I originally did this to load the sample.
[code:1s3eqoy6]mySound=FSOUND_Sample_Load(FSOUND_FREE, (char *)data, FSOUND_LOADMEMORY, size);[/code:1s3eqoy6]

  • You must to post comments
0
0

Firstly can you confirm that the length is indeed correct otherwise the end may be getting cut off, and secondly does the sound loop correctly when loading the file normally from disk, i.e. not FMOD_OPENMEMORY?

Also what is the format of the file you are loading? and what version of FMOD are you using?

  • You must to post comments
0
0

Thanks, that was it. The size I was passing was incorrect. I realized my mistake after taking you suggestion and loading the sound from a file.

Thanks for your help and sorry to waste your time when it was my bug.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.