I have a number of wave files which have their loop points set in Sound Forge (no fancy stuff, just loop infinitely from start to end).
I use FSBankExCl to package them together and CreateSound( FMOD_SOFTWARE ) to load the fsb at runtime.
However, since the sound designer put the loop points into the wave files, I have no way of knowing which ones should be looping (I’m not using the Sound Designer application… Just FMOD Ex).
Is there a way to find out if a sound within an FSB has a loop flag set? Is that stuff stored anywhere?
I thought I could just use getLoopCount on the subsound, but it always returns "infinite looping"
(I just want to play looped samples as looped, and non-looped ones as one-shots… but unless I have fore-knowledge of my audio samples, I can’t seem to do it… am I missing something?)
- collision asked 8 years ago
I tested with 4.31.04 and getLoopPoints is returning valid values for the subsounds which contain loop points. The subsounds which contain no loop points are returning start and end as you described.
Which version are you using?
You are right that the mode is the same for all subsounds so that probably wont be useful for this purpose.
Your createsound flags seem fine.
I’m running with 4.30.03.
The trouble is that my loop points ARE start=0, end=<end>… so if non-looping samples return the same values, how am I to differentiate between ones which have loop points and ones which do not?
Surely a sample with no embedded loops should return start=0,end=0 (or return an FMOD_ERROR on the getLoopPoints call)?
There is no reason to put loop points at the start and end of a file. You can just tell FMOD to loop that file if that is the desired behaviour. The purpose of loop points is to make it loop a specific section of the file.
[quote:3b1nt1nw]Surely a sample with no embedded loops should return start=0,end=0 (or return an FMOD_ERROR on the getLoopPoints call)?[/quote:3b1nt1nw]
If you open a file without loop points and set the FMOD_LOOP_NORMAL flag, then FMOD will loop that file from start to finish. This mode can be modified after it is loaded so it makes sense to return the actual values rather than an error.
What are you trying to acheive?
I don’t know which of my samples have loops in them… they’re produced by our audio engineer.
I want to be able to tell at runtime which samples contain loops and which don’t, so I can set the FMOD_LOOP_NORMAL flag when I issue the playSound call.
Going back to my original question…
– when a sample with actual loop information is loaded into an FSB, and then accessed using getSubSound — is there any way (at runtime) for me to tell if the sample has a loop point embedded in it (from the original WAV file)?
All I want to do is either playSound or playSound( FMOD_LOOP_NORMAL) depending on whether the source wave data actually contains a loop.
So, you’re telling me there is no way to get the ‘loop’ information out of the wave data without fore-knowledge that the wave is looped?
I need to go back to our audio guy and ask him to insert a marker into any waves which he requires looping? (so I can add FMOD_LOOP_NORMAL if getNumSyncPoints != 0) ?
OK, thanks… I just wanted to be absolutely clear before I go back and ask for all the data to be rebuilt.
Seems odd tho… I mean, logically… if a wave file has loop information at source, shouldn’t it play looped when you call playSound (unless you specifically ask it not to by supplying the NONE loop flag)… the current system doesn’t really make much sense to me (but then I’m not a proper audio engineer, so what do I know )… it just seems like you’re throwing away (or ignoring) perfectly good information that was put there for a reason.
I’m either going to have to go back and edit all of the wave data and add sync points, or build some sort of index file with a set of flags for each wave in the FSB (one of which would be a LOOPED flag)
Maybe I’m being dense, but I can’t seem to get this working…
I load the FSB using
CreateSound( FMOD_OPENMEMORY_POINT | FMOD_3D | FMOD_SOFTWARE );
I then locate the sound I want to play
pSound->getSubSound( index, &hSubSound );
pSystem->playSound( FMOD_CHANNEL_FREE, hSubSound, true, &hChannel );
If I do a
hSubSound->getMode( &mode );
hChannel->getMode( &mode );
I always get back the same mode flags… (FMOD_LOOP_OFF | FMOD_3D | FMOD_SOFTWARE | FMOD_3D_WORLDRELATIVE | FMOD_3D_LOGROLLOFF | FMOD_UNICODE )
If I do a
hSubSound->getLoopPoints( &uiStart, FMOD_TIMEUNIT_PCM, &uiEnd, FMOD_TIMEUNIT_PCM );
I always get back
(uiStart == 0) and (uiEnd == waveLength)
I can see no way of differentiating between a sample which has a loop points embedded and one which does not (they both contain loop start/end points)
Am I missing a flag in the CreateSound when loading the FSB perhaps?
Please login first to submit.