Sound PlaybackRate Requires Getter?

We have a setter for sound PlaybackRate.

Didn’t find a getter.

Lets say I want to double the current PlaybackRate. How would I do that?

Maybe there should be a getter, but normal playback speed is 1, so just a multiple of 1. It mirrors HTMLMediaElement.playbackRate HTMLMediaElement.playbackRate - Web APIs | MDN

HTMLMediaElement.playbackRate is public and thus readable.
Babylonjs Sound’s playbackRate isn’t.
Right now I am using sound[“_playbackRate”] to access this private property. Not good.

If I’m not mistaken, this part of the audio controls in BJS is currently being reworked, is it? @RaananW

cc @docEdub as well :slight_smile:

Yup the audio stack is planned to be revamped but in the mean time I added a simple get function to unlock @satguru : Add playback rate getter by sebavan · Pull Request #13312 · BabylonJS/Babylon.js · GitHub

4 Likes

Nice. Thanks