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 23
23
import matplotlib .pyplot as plt
24
24
from IPython .display import Audio
25
25
from torchaudio .utils import download_asset
26
+ import torchaudio
26
27
27
28
######################################################################
28
29
# In this tutorial, we will use a speech data from
32
33
SAMPLE_WAV_SPEECH_PATH = download_asset ("tutorial-assets/Lab41-SRI-VOiCES-src-sp0307-ch127535-sg0042.wav" )
33
34
34
35
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 )
46
38
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 )
49
41
50
42
51
43
def get_spectrogram (
You can’t perform that action at this time.
0 commit comments