RuntimeError: .. torchaudio sox_effects .. requires sox

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\”, line 143, in wrapped
raise RuntimeError(f"{func.module}.{} 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(
            ["lowpass", "4000"],
            ["rate", "8000"],
    codec_applied = F.apply_codec(filtered, sample_rate2, format="gsm")
    return codec_applied

Waiting for your kind help, thank you.

I tried run it from the command line or another IDE, but I still got the error.
I guess the incompatibility problem is related to Windows OS. I didn’t have a problem in Ubuntu.

1 Like

Hi~ Do you solve this problem? I have the same trouble wuwuwu

Unfortunately :frowning: , I couldn’t solve the problem on Windows, but it worked on Ubuntu