Hi,
I’m trying to filtering and sample rate changing for Data Augmentation. Similar to the example in the link below :
“Audio Data Augmentation — PyTorch Tutorials 1.12.1+cu102 documentation”
But I am getting the following error message:
File “C:.…\lib\site-packages\torchaudio_internal\module_utils.py”, line 143, in wrapped
raise RuntimeError(f"{func.module}.{func.name} requires sox")
RuntimeError: torchaudio.sox_effects.sox_effects.apply_effects_tensor requires sox
-My env: Python 3.7.8, PyCharm, win10.
-I have installed win sox. And i have added sox folder to my PATH from Environment Variables
I am sharing a sample code snippet below.
def codec_apply(waveform):
# Apply filtering and change sample rate
filtered, sample_rate2 = torchaudio.sox_effects.apply_effects_tensor(
waveform,
sample_rate,
effects=[
["lowpass", "4000"],
[
"compand",
"0.02,0.05",
"-60,-60,-30,-10,-20,-8,-5,-8,-2,-8",
"-8",
"-7",
"0.05",
],
["rate", "8000"],
],
)
codec_applied = F.apply_codec(filtered, sample_rate2, format="gsm")
return codec_applied
Waiting for your kind help, thank you.