Search code examples
javascripthtmlaudiohtml5-videopitch

Preserve pitch on html video element (preservesPitch, mozPreservesPitch, webkitPreservesPitch)


I'm trying to disable preservesPitch feature on video element that plays slow motion through modifying video.playbackRate

On chrome video.webkitPreservesPitch is undefined, and if I set to false or true there is no difference in sound.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement says "this API has not been standarized"

Do you know any way to disable preservesPitch feature on browsers? Thank you.


Solution

  • Yes, you can disable the pitch preservation feature with

    var el=document.getElementById('videoid')
    el.mozPreservesPitch = false; //Firefox
    el.preservesPitch = false; //Chrome
    

    Default value is true.