Zulko / pianoputer

Use your computer keyboard as a "piano".
http://zulko.github.io/blog/2014/03/29/soundstretching-and-pitch-shifting-in-python/
Other
324 stars 92 forks source link

Another sound file cannot be used #1

Closed culebron closed 10 years ago

culebron commented 10 years ago

This sound file, although having about the same length and similar structure, cannot be opened. I'm not sure what's the reason. (Audacity doesn't support other bitrates, if that's the matter.) https://dl.dropboxusercontent.com/u/6721960/2014/throat.wav.zip

Traceback (most recent call last):
  File "pianoputer.py", line 47, in <module>
    transposed_sounds = [pitchshift(bowl_sound, n) for n in tones]
  File "pianoputer.py", line 39, in pitchshift
    stretched = stretch(snd_array, 1.0/factor, window_size, h) 
  File "pianoputer.py", line 22, in stretch
    s1 =  np.fft.fft(hanning_window * a1)
ValueError: operands could not be broadcast together with shapes (8192) (8192,2) 
Zulko commented 10 years ago

If there is something my little program hasn't, it's flexibility ! I believe the problem is that your wav file has two channels. If you open the file in Audacity and remove one channel (make it mono) it should work.

culebron commented 10 years ago

That did work, thanks! Cople of flies to try :) https://dl.dropboxusercontent.com/u/6721960/2014/throat-singing.zip