-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add loop_mode
to AudioStreamPlayer & AudioStreamPlayback
#65797
Conversation
6cd61cc
to
86bcab3
Compare
0753077
to
5b2af6d
Compare
5b2af6d
to
4be99d2
Compare
The PR is now functional enough to be reviewed! |
b90a6c1
to
394a946
Compare
This PR implemets `loop_mode` for **AudioStreamPlayer**, **AudioStreamPlayer2D**, **AudioStreamPlayer3D** and **AudioStreamPlayback**. This allows changing the looping mode of the **AudioStream**, regardless of how it was imported, even as the stream is playing. By default, for the **AudioStreamPlayer**'s, this property is set to "_Detect_", which lets any generated **AudioStreamPlayback** automatically figure out the `loop_mode`, based on their respective **AudioStream** Resource.
394a946
to
6a562d5
Compare
We discussed it briefly in a PR review meeting, there was no clear consensus in favor of exposing this this way. This should be rediscussed for a future release together with the interactive music enhancements that could also include easier configuration of sample looping. |
Wondering if there has been any update on this. |
The above comment is still relevant. Akien is referring to #64488 which hasn't been merged yet (and won't be for 4.1, as it requires further work). |
any news on Loops? |
Nothing has been recently talked about on this regard. Judging by the last PR review meeting, this is not the maintainers want this feature to be accessed. |
I apologize, but what exactly is being discussed by the team for so long? It has been over a year since this PR is functional and it is a pretty simplistic feature. It's unfortunate that this engine still doesn't allow easily overriding loop mode via player. I would greatly appreciate if you shared some of the concerns the team had with this particular PR. |
Superseded by #86473. |
Implements godotengine/godot-proposals#3120, (minus actually stripping the import)
This PR implemets
loop_mode
for AudioStreamPlayer, AudioStreamPlayer2D, AudioStreamPlayer3D and AudioStreamPlayback.This allows changing the looping mode of the AudioStream, regardless of how it was imported, even as the stream is playing, which leads to pretty interesting results! Imagine playing a sound, keep it looping continuously, until a key is released.
AudioStreamPlayer.loop.mode.mp4
By default, for the AudioStreamPlayer's, this property is set to "Detect", which lets any generated AudioStreamPlayback automatically figure out the
loop_mode
, based on their respective AudioStream Resource.Note is that, the streams may vary a lot (MP3, Ogg, WAV...). Their implementation has been mostly unchanged in this PR, so it is not guaranteed that the given
loop_mode
is supported, if at all, in fact. Whenever this is the case, a warning configuration is issued. When actually playing the AudioStream with AudioStreamPlayback, the variable is internally reassigned to its closest equivalent and a warning is sent to the console (this has been configured manually).The way AudioStreams are imported into the editor is left unchanged. This feature is all on top of it.
What I would like to do:
Hide unsupported Loop Modes from selection when the AudioStream of AudioStreamPlayer does not support them (I believePROPERTY_TYPE_ENUM does not support skipping options (adding that to my list, I suppose). The closest thing is a reminder next to each option.validate_property()
allows you to do this).Optional ideas:
AudioStream.instantiate_playback()
toLoopMode.DETECT
._set_loop_mode()
and_get_unsupported_loop_modes()
methods to GDScript.loop_begin
andloop_end
(if supported).Feedback is absolutely appreciated.
I am particularly concerned about the naming. Perhaps it should be called
loop_mode_override,
or something along those lines in the AudioStreamPlayers. Orplayback_mode
(renaming the constants accordingly, too) because that's technically what it is, actually? I was getting confused a bit while working on it,