Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound ducking release too abrupt when stopping a sound #415

Open
qcapen opened this issue Jan 21, 2021 · 1 comment
Open

Sound ducking release too abrupt when stopping a sound #415

qcapen opened this issue Jan 21, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@qcapen
Copy link
Collaborator

qcapen commented Jan 21, 2021

From the mpf-users discussion group:
Greg Sealbygregorysealby@gmail.com
Jan 21, 2021 8:13 AM
to MPF Users
Just playing around with some sounds and ducking. I have a need to play a sound on the SFX track and ducking the music track. The attack value works and the SFX slowly fades in. I play this sound for about 20 seconds and then stop the sound as the mode is over. The Ducking Attenuation does not seem to work for a "stop" sound player command. The music track abruptly starts playing again as soon as the SFX track sound is stopped.

Does ducking only work when the sound file itself finishes? Would seem odd.

@qcapen qcapen added the bug label Jan 21, 2021
@qcapen qcapen added this to the 0.54 milestone Jan 21, 2021
@qcapen qcapen self-assigned this Jan 21, 2021
@qcapen
Copy link
Collaborator Author

qcapen commented Jan 21, 2021

This is a bug/design flaw in the audio engine. Currently the ducking calculations are currently performed in the processing for each sound (since the ducking settings are tied directly to a sound). When a sound is stopped, it is no longer in the processing queue and therefore its ducking information simply disappears with it. I had placed several TODO items in the code related to this issue, but had forgotten about addressing it and you are the first person to notice. The ducking processing needs to be redesigned to allow it to continue to process after a sound has finished (whether stopped or simply runs to the end).

What should happen to the ducking when a sound is stopped?

  • Situation 1: Sound is stopped with no fade out. I think it's pretty clear that the ducking release should kick in at this point. Should the ducking release time ever be shortened in this situation? Perhaps have a normal ducking release time and an optional sound stopped ducking release time in the config? I don't want to make this too complicated.
  • Situation 2: Sound is stopped with a fade out that is shorter or equal to the ducking release time. Again, this is just like Situation 1 where the ducking release should begin immediately.
  • Situation 3: Sound is stopped with a fade out time that is longer than the ducking release time. In this situation it is not really clear to me what we should do. I'm leaning towards treating the end of the fade out as the new end of the sound and trigger the ducking release at the specified time (relative to the new ending time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant