e@0: # -*- coding: utf-8 -*- e@0: """ e@0: Created on Tue Jun 9 16:39:46 2015 e@0: e@0: @author: mmxgn e@0: """ e@0: e@0: e@0: from numpy import * e@0: from matplotlib.pyplot import * e@0: import pyaudio e@0: e@0: SR = 44100 e@0: e@0: t = linspace(0, 1, SR) e@0: e@0: f0 = 440. e@0: e@0: y = 0.5*sin(2*pi*f0*t) e@0: e@0: e@0: player = pyaudio.PyAudio() e@0: stream = player.open(format=pyaudio.paFloat32, channels=1,rate=SR,output=True) e@0: e@0: stream.start_stream() e@0: stream.write(y) e@0: stream.close() e@0: e@0: #plot(t, y)