Skip to content

Commit c99d0d1

Browse files
Remove sox effect (#4005)
1 parent dad176d commit c99d0d1

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

examples/tutorials/audio_feature_augmentation_tutorial.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import matplotlib.pyplot as plt
2424
from IPython.display import Audio
2525
from torchaudio.utils import download_asset
26+
import torchaudio
2627

2728
######################################################################
2829
# In this tutorial, we will use a speech data from
@@ -32,20 +33,11 @@
3233
SAMPLE_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

5143
def get_spectrogram(

0 commit comments

Comments
 (0)