File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change 2323import matplotlib .pyplot as plt
2424from IPython .display import Audio
2525from torchaudio .utils import download_asset
26+ import torchaudio
2627
2728######################################################################
2829# In this tutorial, we will use a speech data from
3233SAMPLE_WAV_SPEECH_PATH = download_asset ("tutorial-assets/Lab41-SRI-VOiCES-src-sp0307-ch127535-sg0042.wav" )
3334
3435
35- def _get_sample (path , resample = None ):
36- effects = [["remix" , "1" ]]
37- if resample :
38- effects .extend (
39- [
40- ["lowpass" , f"{ resample // 2 } " ],
41- ["rate" , f"{ resample } " ],
42- ]
43- )
44- return torchaudio .sox_effects .apply_effects_file (path , effects = effects )
45-
36+ def _get_sample (path ):
37+ return torchaudio .load (path )
4638
47- def get_speech_sample (* , resample = None ):
48- return _get_sample (SAMPLE_WAV_SPEECH_PATH , resample = resample )
39+ def get_speech_sample ():
40+ return _get_sample (SAMPLE_WAV_SPEECH_PATH )
4941
5042
5143def get_spectrogram (
You can’t perform that action at this time.
0 commit comments