py_vad_tool icon indicating copy to clipboard operation
py_vad_tool copied to clipboard

Can't use your script

Open ghost opened this issue 7 years ago • 2 comments

home@home-lnx:~/py_vad_tool$ ./unsupervised_vad.py
Traceback (most recent call last):
  File "./unsupervised_vad.py", line 106, in <module>
    fs,s = read_wav(test_file)
  File "/home/home/py_vad_tool/audio_tools.py", line 21, in read_wav
    fs, s = wavfile.read(filename) # scipy reads int
  File "/usr/lib/python2.7/dist-packages/scipy/io/wavfile.py", line 233, in read
    fid = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: '/Users/navidshokouhi/Software_dir/subspace_speechenhancement/data/sa1-falr0_noisy.wav'

ghost avatar Sep 03 '18 11:09 ghost

After changing the input to my file test_file='./input.wav' this is the newer error message

home@home-lnx:~/py_vad_tool$ ./unsupervised_vad.py
Traceback (most recent call last):
  File "./unsupervised_vad.py", line 107, in <module>
    fs,s = read_wav(test_file)
  File "/home/home/py_vad_tool/audio_tools.py", line 22, in read_wav
    s = np.array(s)/float(max(abs(s)))
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

ghost avatar Sep 03 '18 11:09 ghost

Thanks for bringing this to my attention. I checked this myself with a sample file. It seems to work well. The problem could be with the wav-file. Please try with the sample I've added to see if you still get that same error.

Alternatively, try using np.max and np.abs instead of max and abs in read_wav.

Cheers, NS

idnavid avatar Sep 03 '18 22:09 idnavid