Skip to content

Instantly share code, notes, and snippets.

@008karan
Last active January 21, 2020 10:46
Show Gist options
  • Save 008karan/019dbb899a88743732f7f6af332aa4dc to your computer and use it in GitHub Desktop.
Save 008karan/019dbb899a88743732f7f6af332aa4dc to your computer and use it in GitHub Desktop.
import librosa
import nlpaug.augmenter.audio as naa
file='sample.wav'
out='pitched_sample.wav'
audio, sampling_rate = librosa.load(file,sr=8000)
aug_pitch = naa.PitchAug(sampling_rate=sampling_rate,pitch_range=(1,2))
augmented_pitch = aug_pitch.substitute(audio)
librosa.output.write_wav(out,augmented_pitch,sr=8000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment