Skip to content

Instantly share code, notes, and snippets.

@xprilion
Created June 20, 2021 16:07
Show Gist options
  • Save xprilion/9a59895a1434ab0b1c5355046c995798 to your computer and use it in GitHub Desktop.
Save xprilion/9a59895a1434ab0b1c5355046c995798 to your computer and use it in GitHub Desktop.
Change sample rate of wavefile without speeding up the audio
import librosa
import soundfile as sf
filepath = "sample.wav"
y, s = librosa.load(filepath, sr=16000)
sf.write(filepath, y, s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment