0
0

Hey all. How can I end a sound on a specific sample?

Cheers
-Scott

  • You must to post comments
0
0

Well, I tried setting a sync point where I want the sound to stop, and set up a callback for sync points on the channel when it plays the sound, calling pause in the callback. It doesn’t stop the sound perfectly on the sample still though – I was afraid of that.

What else could I try…

  • You must to post comments
0
0

poty 😀
i don’t think FMOD can do this yet, unless you write your own stream player. all callbacks and access to samples are per buffer rate.

  • You must to post comments
0
0

So basically, if say it was for mp3s (or whatever), decode the mp3 to memory as I need it and have a user sample playing where I can stop the data flow on the sample I want in the read callback… is that how others are doing it?

Cheers
-Scott

  • You must to post comments
0
0

maybe you could add a user DSP callback to the channel, then count the number of samples coming in, then after a certain number of samples – mute the data to 0’s from that point on? Set a flag here as well to actually stop the voice afterwards.

What you would get is the voice audibly stops exactly at the sample you want it (ie mutes), then really stops a bit later.

  • You must to post comments
0
0

funny
i tried something similar but using sound.exinfo.pcmreadcallback. passing channel pointer as userdata was messy and calls don’t work (i assume internal thread stuff?) but setting the data to 0 did work. i found i also had to have a reset flag since i only had number of bytes being passed (for each time the sound was played).
i will try doing this all in the DSP chain. but i might imp. an envelope DSP with flags. This way there is even more control over the sound stopping (and starting) with possible cross-fades. thanks for the tip

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.