Mercurial > hg > chourdakisreiss2016
diff experiment-reverb/code/pyaudioplay.py @ 0:246d5546657c
initial commit, needs cleanup
author | Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk> |
---|---|
date | Wed, 14 Dec 2016 13:15:48 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/experiment-reverb/code/pyaudioplay.py Wed Dec 14 13:15:48 2016 +0000 @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 9 16:39:46 2015 + +@author: mmxgn +""" + + +from numpy import * +from matplotlib.pyplot import * +import pyaudio + +SR = 44100 + +t = linspace(0, 1, SR) + +f0 = 440. + +y = 0.5*sin(2*pi*f0*t) + + +player = pyaudio.PyAudio() +stream = player.open(format=pyaudio.paFloat32, channels=1,rate=SR,output=True) + +stream.start_stream() +stream.write(y) +stream.close() + +#plot(t, y) \ No newline at end of file