How to change the pitch with JavaScript?
问题 Let’s say you have an audio variable called audio and it stores a sound. I know how to change the speed for example: audio.playBackRate = 2; But I don't know how to change the pitch. Is there an audio.pitch attribute or do I have to create it myself? I want to do something like this: var audio = new Audio(); audio.src = "sound_effect.wav"; audio.pitch = 2 //doubling the pitch but there is no pitch attribute audio.play(); 回答1: I think you need to use a library to apply pitch shifting to your