You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed cochlea-master on Windows 8 with Anaconda(python2.7 64-bit). It works successfully in jupyter notebook to processing a generated sound as shown in usage website. Then I am trying to run the example by using a sound file but there is something wrong.
C:\Users\Alice\Desktop\cochlea-master\cochlea-master\scripts>python run_zilany2014 --hsr=100 --msr=75 --lsr=25 --cf=1000 --species=human --seed=0 --dbspl=60 tone.wav
Processing tone.wav
Traceback (most recent call last):
File "run_zilany2014", line 162, in
main(args)
File "run_zilany2014", line 155, in main
space
File "run_zilany2014", line 108, in convert_sound_to_mat_unpack
convert_sound_to_mat(**args)
File "run_zilany2014", line 72, in convert_sound_to_mat
sound_raw = wv.resample(sound_raw, int(f.samplerate), int(fs))
File "C:\ProgramData\Anaconda3\envs\py27\lib\site-packages\thorns\waves.py", l
ine 100, in resample
new_signal = dsp.resample(signal, len(signal)*new_fs/fs)
File "C:\ProgramData\Anaconda3\envs\py27\lib\site-packages\scipy\signal\signal
tools.py", line 2203, in resample
Y = zeros(newshape, 'D')
TypeError: 'float' object cannot be interpreted as an index
Hi! Thanks for the bug report in the resample(). I've fixed it in the
repository of thorns.
but then there were some other asserting problems.
(like "assert sound.ndim == 1". I checked my data, in which the sound.ndim=2).
I am new to python and I 'm not sure why this may be. Could you help me with it?
So run_zilany2014() is a model of a single ear, i.e., it expects one
dimensional signal as input. I guess that you are using a wave file
with 2 channels (stereo). If you convert it to mono, it should work.
I installed cochlea-master on Windows 8 with Anaconda(python2.7 64-bit). It works successfully in jupyter notebook to processing a generated sound as shown in usage website. Then I am trying to run the example by using a sound file but there is something wrong.
C:\Users\Alice\Desktop\cochlea-master\cochlea-master\scripts>python run_zilany2014 --hsr=100 --msr=75 --lsr=25 --cf=1000 --species=human --seed=0 --dbspl=60 tone.wav
Processing tone.wav
Traceback (most recent call last):
File "run_zilany2014", line 162, in
main(args)
File "run_zilany2014", line 155, in main
space
File "run_zilany2014", line 108, in convert_sound_to_mat_unpack
convert_sound_to_mat(**args)
File "run_zilany2014", line 72, in convert_sound_to_mat
sound_raw = wv.resample(sound_raw, int(f.samplerate), int(fs))
File "C:\ProgramData\Anaconda3\envs\py27\lib\site-packages\thorns\waves.py", l
ine 100, in resample
new_signal = dsp.resample(signal, len(signal)*new_fs/fs)
File "C:\ProgramData\Anaconda3\envs\py27\lib\site-packages\scipy\signal\signal
tools.py", line 2203, in resample
Y = zeros(newshape, 'D')
TypeError: 'float' object cannot be interpreted as an index
I tried to transform the datatype into int
waves.py
100: new_signal = dsp.resample(signal, len(signal)*new_fs/fs)
replaced by: new_signal = dsp.resample(signal, int(len(signal)*new_fs/fs))
but then there were some other asserting problems.
(like "assert sound.ndim == 1". I checked my data, in which the sound.ndim=2).
I am new to python and I 'm not sure why this may be. Could you help me with it?
The text was updated successfully, but these errors were encountered: