4

I am using wavesufer for generating waves for Audio file and other features around that.

Whenever I try to update playbackRate, sound pitch changes weirdly. I have used below few methods.

wavesurfer.audioRate = 2
wavesurfer.backend.setPlaybackRate(2)
wavesurfer.backend.params.audioRate.value = 2

I have checked on wavesufer site, blog, documentation but still not clear how to change playbackRate without affecting sound pitch.

Vikas Vaidya
  • 358
  • 3
  • 15
  • Isn't that the nature of playback at 3x? To the human ear, at that speed, it's expected to sound weird. – zer00ne Dec 12 '16 at 01:11
  • If we do the same with HTML5 Audio, it works better but with wavesurfer its get funny even at 1.5. – Vikas Vaidya Dec 12 '16 at 01:14
  • Maybe normalize the audio source first? – zer00ne Dec 12 '16 at 01:19
  • Audio Normalize is more towards peak and loudness normalization, not sure if its for sound pitch as well. Also, there are millions of Audio files so I am looking for compatibility in wavesurfer itself. – Vikas Vaidya Dec 12 '16 at 01:25

1 Answers1

1

The answer for this is here: https://github.com/katspaugh/wavesurfer.js/issues/149

You need to specify this initialization option in the create() call:

backend: 'MediaElement'

This should preserve the original pitch.

Carlos Peixoto
  • 129
  • 1
  • 3