Can anyone tell me how to use ‘Sound::addSyncPoint’ and ‘Sound::getSyncPoint’ to stop a sound after a certain number of milliseconds?
I can use sddSyncPoint without any errors, but I don’t know how to use that SyncPoint to stop the sound. Any ideas? Or is there another way to do this?
- Catz asked 11 years ago
for memory, you need to use a custom channel callback and set it as a sync-point type callback. the idea is that the callback is called every time the stream comes across a sync-point. i think that this isn’t byte accurate as the callback is called per buffer cycle. it would be worth checking ie. placing 2 sync-points with their difference being less than streamed buffer size.
- sohla answered 11 years ago
You can just call Channel::stop from a sync point callback (as of 4.08.09)
It will be roughly the right time, meaning it is dependent on your framerate (the callback is generated from the main thread and System::update for thread safety reasons).
I updated to 4.08.09 (from 4.06.19) and there were a few problems. I use Delphi 5, I know you don’t support the Delphi headers but I thought I should bring your attention to the following:-
Fmodtypes.pas line 1048
I have to remove this line before I can compile. FMOD_TIMEUNIT is not defined.
I can no longer use FMOD_OPENMEMORY for some reason. It is defined, but createsound fails when I use this flag.
I’m going to have to go back to 4.06.19, any chance of some example code to stop a sound with a sync point using this version?
- Catz answered 11 years ago
Please login first to submit.