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 changing the loop value for a sound already started did not work #8745

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions dist/preview release/what's new.md
Expand Up @@ -284,6 +284,7 @@
- Fix docs Matrix.RotationYawPitchRoll and Matrix.RotationYawPitchRollToRef ([VSerain](https://github.com/VSerain))
- Fix issue in `GLTFLoader._updateBoneMatrices()` where bone rest position was not set. ([drigax](https://github.com/drigax))
- Fix the bounding box of instances that does not match the instance position / rotation / scaling ([Popov72](https://github.com/Popov72))
- Fix changing the loop value (by calling `updateOptions`) for a sound already started did not work ([Popov72](https://github.com/Popov72))

## Breaking changes
- `FollowCamera.target` was renamed to `FollowCamera.meshTarget` to not be in conflict with `TargetCamera.target` ([Deltakosh](https://github.com/deltakosh))
Expand Down
2 changes: 2 additions & 0 deletions src/Audio/sound.ts
Expand Up @@ -469,10 +469,12 @@ export class Sound {
if (this.isPlaying) {
if (this._streaming && this._htmlAudioElement) {
this._htmlAudioElement.playbackRate = this._playbackRate;
this._htmlAudioElement.loop = this.loop;
}
else {
if (this._soundSource) {
this._soundSource.playbackRate.value = this._playbackRate;
this._soundSource.loop = this.loop;
}
}
}
Expand Down