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…
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?
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.
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
Please login first to submit.