Skip to content

Is it possible to also change pitch when using setPlaybackRate()? #2673

Answered by katspaugh
tombburnell asked this question in Q&A
Discussion options

You must be logged in to vote

@tombburnell that's due to how modern browsers deal with the playback speed. From MDN:

The pitch of the audio is corrected by default. You can disable pitch correction using the HTMLMediaElement.preservesPitch property.

See https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/playbackRate

You can see in this example, I've disabled preservePitch, and it produces a comical chipmunk voice when you press "octave up": https://codepen.io/katspaugh/pen/xxaYLRa

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by katspaugh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants
Converted from issue

This discussion was converted from issue #2639 on February 26, 2023 09:14.