-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Improve AudioStream looping #86517
base: master
Are you sure you want to change the base?
Improve AudioStream looping #86517
Conversation
* AudioStream (OGG/MP3) import dialog now allows to optionally set loop in beats. * Loop points other than zero now properly fade-in to avoid clicks. Keep in mind if you have strong transients in the loop they may be smoothed due to the fade, so consider eventually separating in two clips and use upcoming AudioStreamPlaybackPlaylist or AudioStreamPlaybackInteractive. * Stream import dialog now indicates the beat where loop occurs. * Cleaned up the import dialog a bit.
9c7c9bd
to
89b20b8
Compare
@reduz: please make the PR title a little more explicit, e.g. "Improve AudioStream looping when using BPM logic", as looping in seconds stays unaffected |
@MJacred It also fixes the clicking sound of regular loops when position is not zero. |
(on mobile so I can't review fully) Does this also fade in if you call |
@reduz: |
@ellenhp: on |
Unless someone removed that logic since #71780 it's definitely still in there. Imo we should move that fade to be triggered by a seek. I'm not sure if it's been suggested but I want to preemptively say I strongly disagree with moving fade-out logic into the playbacks because that'll introduce pops when an audio stream player is removed from the tree without being stopped. Fade-in and loop fades (both triggered by a seek operation) can be moved to playbacks without introducing bugs I think. |
Ok, you're right. I relied on variable naming. So if there's just some non-descriptive (for me at least) math going on, I missed it. |
Yeah it's not documented well which is on me. |
There's no developer who hasn't neglected documentation before. But you can dump your knowledge here godotengine/godot-docs#7896 (or just reference valuable PRs/proposals/issues, where I can read up) and we'll have something that sticks around in one place :D (PR hijacking over and out) |
The docs need to be added for the new members: diff --git a/modules/minimp3/doc_classes/ResourceImporterMP3.xml b/modules/minimp3/doc_classes/ResourceImporterMP3.xml
index a84c51c..e46285b 100644
--- a/modules/minimp3/doc_classes/ResourceImporterMP3.xml
+++ b/modules/minimp3/doc_classes/ResourceImporterMP3.xml
@@ -33,5 +33,7 @@
Only has an effect if [member loop] is [code]true[/code].
A more convenient editor for [member loop_offset] is provided in the [b]Advanced Import Settings[/b] dialog, as it lets you preview your changes without having to reimport the audio.
</member>
+ <member name="loop_offset_type" type="int" setter="" getter="" default="0">
+ </member>
</members>
</class>
diff --git a/modules/vorbis/doc_classes/ResourceImporterOggVorbis.xml b/modules/vorbis/doc_classes/ResourceImporterOggVorbis.xml
index dd6c181..8f225e8 100644
--- a/modules/vorbis/doc_classes/ResourceImporterOggVorbis.xml
+++ b/modules/vorbis/doc_classes/ResourceImporterOggVorbis.xml
@@ -49,5 +49,7 @@
Only has an effect if [member loop] is [code]true[/code].
A more convenient editor for [member loop_offset] is provided in the [b]Advanced Import Settings[/b] dialog, as it lets you preview your changes without having to reimport the audio.
</member>
+ <member name="loop_offset_type" type="int" setter="" getter="" default="0">
+ </member>
</members>
</class> (and the descriptions written) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code and rationale seem fine to me. Didn't test.
loop_offset->set_tooltip_text(TTR("Loop offset (from beginning). Note that if BPM is set, this setting will be ignored.")); | ||
loop_offset->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); | ||
loop_hb->add_child(loop_offset); | ||
loop_offset_type = memnew(OptionButton); | ||
loop_offset_type->add_item(TTR("Sec")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't seem to width constrained here so I would avoid abbreviations, which can be hard to translate.
loop_offset_type->add_item(TTR("Sec")); | |
loop_offset_type->add_item(TTR("Seconds")); |
Will do the changes suggested ASAP. |
Postponing to 4.4 as we're now in feature freeze for 4.3, and this still needs some more work. |
Screenshot: