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.
- OrganicBytes asked 7 years ago
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.
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]
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?
Please login first to submit.