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


Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.

In [17]:
input_signal, sampling_rate, enc = audio.wavread("FourierTalkOSCON/audio_files/vowel_ah.wav")

print (input_signal[0:10]), sampling_rate, enc


[  0.00000000e+00   0.00000000e+00   0.00000000e+00   0.00000000e+00
  -3.05175781e-05   0.00000000e+00   0.00000000e+00   0.00000000e+00
   0.00000000e+00   0.00000000e+00] 44100 pcm16

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]:
<matplotlib.text.Text at 0x42d7750>

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()

Using sox:

En la consola para grabar usar:

rec -c 1 -b 16 darthvader.wav


In [ ]: