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

Keyframed AudioStreamPlayer keeps playing audio even when AnimationPlayer playback is stopped #54183

Open
Tracked by #76797
CenTdemeern1 opened this issue Oct 24, 2021 · 7 comments

Comments

@CenTdemeern1
Copy link

Godot version

3.3.* (should work for any Godot version)

System information

Windows 10, but this shouldn't matter

Issue description

When keyframing an AudioStreamPlayer like this, and stopping playback, the AudioStreamPlayer node keeps playing its sound.
image
Scrubbing on the timeline also causes it to play, which is really distracting.

Steps to reproduce

Create an AnimationPlayer node with an animation, and create an AudioStreamPlayer node.
Give the AudioStreamPlayer an audio stream in the Stream property, and keyframe the Playing property (with the value true).
Make sure the animation playback is stopped, and scrub over the audio clip on the timeline.
Annoyingly, this makes the audio clip play.

Minimal reproduction project

Repro-AudioStreamAnimationPlayer.zip

@Calinou
Copy link
Member

Calinou commented Oct 26, 2021

This isn't necessarily a bug, and may have been done this way by design. Stopping sound playback abruptly isn't always conductive to a good experience, so you may want the last sound to linger on when stopping animation playback.

The above comment applies both to AudioStreamPlayer's Playing property and the Audio playback track (which are entirely different).

@CenTdemeern1
Copy link
Author

This isn't necessarily a bug, and may have been done this way by design. Stopping sound playback abruptly isn't always conductive to a good experience, so you may want the last sound to linger on when stopping animation playback.

The above comment applies both to AudioStreamPlayer's Playing property and the Audio playback track (which are entirely different).

Then you should be able to disable this behavior, at least!

@Calinou
Copy link
Member

Calinou commented Oct 26, 2021

Then you should be able to disable this behavior, at least!

I don't think we need a dedicated property in AnimationPlayer for this. Instead, you can call the appropriate method in AudioStreamPlayer to forcibly stop audio playback when you stop animation playback (or queue_free() the AudioStreamPlayer node if it's not needed anymore). Method call tracks can be useful here, but you can also do this in the script where you stop the animation playback.

As for muting the editor audio when scrubbing through the timeline, you can use your OS' audio mixer settings to change volume on a per-application basis. The Godot editor and running project are considered separate applications for this purpose. See also godotengine/godot-proposals#1066, although I feel having in-editor functionality is only relevant on macOS which doesn't come with per-application volume settings by default.

@CenTdemeern1
Copy link
Author

I don't think you understand the issue.
I'm talking about in the editor, and ONLY in the editor
So I can't call a function or whatever
Also I never said muting during scrubbing, I said that the audio clip triggers (from the start!!!) no matter where you scrub

@TokageItLab
Copy link
Member

TokageItLab commented Nov 10, 2021

I think that the AudioPlaybackTrack is not designed to play long audio like BGM in the first place, but to sequence short sound effects.
Stopping the AudioStreamPlayer at the same time as the animation means that when you place the sound effect at the end of the animation, you will need to offset it for the sound effect. Perhaps, #41180 is a PR that addresses them...? @TypeOverride2 May I ask your opinion on this?

@berarma
Copy link
Contributor

berarma commented May 21, 2024

I think it should be made more clear in the title and description that the problem is in the editor.

@CenTdemeern1
Copy link
Author

I think it should be made more clear in the title and description that the problem is in the editor.

Look I appreciate the feedback but it’s been almost 3 years since I created this github issue and I don’t remember all the details and I kind of don’t feel like testing this again on the latest release so if you have any suggestions for edits I’m all ears but right now I kind of don’t have the energy to read through all this, test it, and think of something myself

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

No branches or pull requests

4 participants