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

Fix sound play function not accepting zero as a valid offset #13425

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

docEdub
Copy link
Contributor

@docEdub docEdub commented Jan 9, 2023

The Sound.play function is not accepting zero as a valid offset. This makes resetting the offset to zero not work after previously setting it to a non-zero value.

Reported on forum here: https://forum.babylonjs.com/t/pausing-and-playing-an-audio-with-offset-restarts-it-from-the-beginning-instead-of-the-current-position/36668/12

This change fixes the issue by comparing the given offset argument to undefined instead of using JavaScript truthy/falsey.

This bug was caused by the change I made in #13373.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 9, 2023

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented Jan 9, 2023

@docEdub docEdub merged commit 5a41017 into BabylonJS:master Jan 9, 2023
@docEdub docEdub deleted the 230109-fix-zero-sound-offset branch January 19, 2023 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants