miniaudio icon indicating copy to clipboard operation
miniaudio copied to clipboard

ma_sound_is_playing returns false, but ma_sound_get_current_fade_volume is not zero

Open jankrassnigg opened this issue 10 months ago • 2 comments

I'm using ma_sound_stop_with_fade_in_milliseconds to fade a sound out, and when it is done, I want to clean it up.

Basically I want this: https://github.com/mackron/miniaudio/discussions/867

But since that's not available yet, I'll just do some bookkeeping myself.

While testing how to do this, I found that calling ma_sound_is_playing my sound will correctly return false when the fade out is finished, ma_sound_get_current_fade_volume will not return zero, but something slightly larger.

I just assume this is a minor error in advancing the playhead to the very end when the sound is done fading out, or something like that.

jankrassnigg avatar Mar 20 '25 10:03 jankrassnigg

Yeah I wonder if this could indeed be a subtle error where miniaudio detects the sound has stopped and it just hasn't applied the fade out calculation for the last audio update? I'll mark this as a bug and investigate.

When this happens, has the sound reached the end of it's data source? I would expect this behaviour if the sound has reached the end of the data source before the fade out completes.

mackron avatar Mar 22 '25 22:03 mackron

As far as I remember this always happened during my tests, no matter where it ended.

jankrassnigg avatar Mar 22 '25 22:03 jankrassnigg