Closed npisanti closed 1 year ago
I think both of your suggestions are reasonable. Certainly I've had people ask how to stop popping sounds when stopping and I've just flippantly said fade it out, so having a way to fade out and stop would be nice.
Will leave this ticket open. No timeframe on when I'll get to this.
I've added initial implementations of ma_sound_set_fade_start_in_pcm_frames()
and ma_sound_set_fade_start_in_milliseconds()
to the dev branch. Only difference with your proposal is the start time is the last parameter. I've only done limited testing so far.
I've also added support for stopping with a fade out. See commit message for details: https://github.com/mackron/miniaudio/commit/53907863c7b5ff2debf7106c1d6648f7fb6232e3. This is in the dev branch.
Thank you very much for adding this feature, I will test it as soon as i'm updating the libraries on some of my projects =)
It would be nice to be able to schedule fades like this
this would let sync the fade out of a sound with the triggering of another sound (expecially useful for choking percussions), or it could also be useful to sync a fade in with a fade out.
Having a fadeout parameter to
ma_sound_set_stop_time_in_pcm_frames()
could also be another viable solution, as most of the time you don't want the sounds to stop abruptly with a click.