Quick question –
Is there a good way to enumerate all the syncpoints on a designer-authored event (or on all the wavs associated with the event)? I am using the syncpoint callback on an instance which is playing, and that works out great.
I would however like to get all the info from the syncpoints before they actually get hit. I noticed that the base-layer fmodex ‘Sound’ class has a getNumSyncPoints, but I am not sure how to get one of those from my event. Is this possible, or is pre-playing the sound and waiting for the callback, the only way to do it? In this case, my event is not dynamic. Thanks!
- kevins asked 10 years ago
Currently I have three options –
1 – preprocess the syncpoints ahead of time, wait through each track to play to get the callback, then save the data out as a separate file, alongside the fev project file.
2 – play a ‘proxy’ track n seconds ahead of time before the points are actually needed. This requires a second stream active on the bank, and a fixed amount of lead-time before the points are needed. However, no preprocessiong.
3 – enumarate all syncpoints from all sounddefs inside each event.
Option 3 is most preferable to me, but I am not sure how to bridge fmodex api from the designer API, i.e. get a set of class SOUND from a class EVENT. Any hints? Is this easy, or should I stick to option 1 or 2? Thanks!
To get the FMOD::Sound object from an event you can do the following:
[code:15qzgcq2]FMOD_RESULT Event::getChannelGroup( FMOD::ChannelGroup ** channelgroup);[/code:15qzgcq2]
[code:15qzgcq2]FMOD_RESULT ChannelGroup::getChannel( int index, FMOD::Channel ** channel);[/code:15qzgcq2]Here the index will be zero if there is only one sound definition in the event. Otherwise it might be a little more complicated.
[code:15qzgcq2]FMOD_RESULT Channel::getCurrentSound( FMOD::Sound ** sound);[/code:15qzgcq2]
I tested this and it returns the correct number of syncpoints. You must do all this AFTER calling Event::start().
- Guest answered 10 years ago
Please login first to submit.