-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Document AudioStreamPlayer.get_playback_position()
intentionally always returning 0.0
when using AudioStreamInteractive
#99200
Conversation
AudioStreamPlayer.get_playback_position() intentionally aways returning
0.0 when using
AudioStreamInteractive`AudioStreamPlayer.get_playback_position()
intentionally aways returning 0.0
when using AudioStreamInteractive
doc/classes/AudioStreamPlayer.xml
Outdated
@@ -22,6 +22,7 @@ | |||
<description> | |||
Returns the position in the [AudioStream] of the latest sound, in seconds. Returns [code]0.0[/code] if no sounds are playing. | |||
[b]Note:[/b] The position is not always accurate, as the [AudioServer] does not mix audio every processed frame. To get more accurate results, add [method AudioServer.get_time_since_last_mix] to the returned position. | |||
[b]Note:[/b] The returned position is always [code]0.0[/code] if the [AudioStream] is [AudioStreamInteractive]. [AudioStreamInteractive] may have multiple clips with transitions between them. This means that the playback position loses meaning, especially during transitions. |
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.
[b]Note:[/b] The returned position is always [code]0.0[/code] if the [AudioStream] is [AudioStreamInteractive]. [AudioStreamInteractive] may have multiple clips with transitions between them. This means that the playback position loses meaning, especially during transitions. | |
[b]Note:[/b] The returned position is always [code]0.0[/code] if the [member stream] is of type [AudioStreamInteractive], since it can have multiple clips playing at once. |
I think it can be a bit shorter while still getting the point across. + refers to the "stream" property now instead of the class. Feel free to tweak my suggestion further if you like :)
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.
You can also add particularly during transitions.
at the end if wanted, but I didn't think it's necessary to understand this behavior. And the sentence would get a bit long :p
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.
Continuing with the above suggestion.
[b]Note:[/b] The returned position is always [code]0.0[/code] if the [AudioStream] is [AudioStreamInteractive]. [AudioStreamInteractive] may have multiple clips with transitions between them. This means that the playback position loses meaning, especially during transitions. | |
[b]Note:[/b] This method always returns [code]0.0[/code] if the [member stream] is an [AudioStreamInteractive], since it can have multiple clips playing at once. |
I do agree to keep verbosity at a minimum, especially because this method doesn't have a "strict" dependance on this class. That is to say that you don't need to know about AudioStreamInteractive to make use of this method.
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.
That makes very much sense! Thank you very much for the feedback. I have fixed it now :)
AudioStreamPlayer.get_playback_position()
intentionally aways returning 0.0
when using AudioStreamInteractive
AudioStreamPlayer.get_playback_position()
intentionally aways returning 0.0
when using AudioStreamInteractive
…ways returning `0.0` when using `AudioStreamInteractive`
Thanks! Congratulations on your first contribution! 🎉 |
AudioStreamPlayer.get_playback_position()
intentionally aways returning 0.0
when using AudioStreamInteractive
AudioStreamPlayer.get_playback_position()
intentionally always returning 0.0
when using AudioStreamInteractive
Fix #97791
AudioStreamPlayer.get_playback_position()
always returns0.0
if theAudioStream
for theAudioStreamPlayer
isAudioStreamInteractive
. This is intended behaviour that lacks documentation, as confirmed by #97806 (comment) and #97791 (comment). This pull requests adds documentation for the behaviour to the class reference.