bajar el archivo scikits.audiolab-0.11.0.tar.gz
de https://pypi.python.org/pypi/scikits.audiolab#downloads
y luego dentro de la carpeta /scikits.audiolab-0.11.0
ejecutar en la consola python setup.py install
In [15]:
import scikits.audiolab as audio
from scipy.fftpack import fft, fftfreq
%pylab inline
In [17]:
input_signal, sampling_rate, enc = audio.wavread("FourierTalkOSCON/audio_files/vowel_ah.wav")
print (input_signal[0:10]), sampling_rate, enc
In [18]:
time_array = arange(0, len(input_signal)/float(sampling_rate), 1/float(sampling_rate))
In [22]:
plot(time_array[0:4000], input_signal[0:4000])
xlabel("time(s)", fontsize=20)
ylabel("Amplitude", fontsize=20)
Out[22]:
In [78]:
n = len(time_array) # number of point in the whole interval
f = 200.0 # frequency in Hz
dt = 1 / (f * n/7. ) #32 samples per frequency
In [173]:
output_file = audio.Sndfile("darthvader.wav", 'w', audio.Format('wav'), 1, sample_rate)
In [174]:
output_file.write_frames(out.real)
output_file.close()
In [ ]: