annotate experiment-reverb/code/pyaudioplay.py @ 2:c87a9505f294 tip

Added LICENSE for code, removed .wav files
author Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk>
date Sat, 30 Sep 2017 13:25:50 +0100
parents 246d5546657c
children
rev   line source
e@0 1 # -*- coding: utf-8 -*-
e@0 2 """
e@0 3 Created on Tue Jun 9 16:39:46 2015
e@0 4
e@0 5 @author: mmxgn
e@0 6 """
e@0 7
e@0 8
e@0 9 from numpy import *
e@0 10 from matplotlib.pyplot import *
e@0 11 import pyaudio
e@0 12
e@0 13 SR = 44100
e@0 14
e@0 15 t = linspace(0, 1, SR)
e@0 16
e@0 17 f0 = 440.
e@0 18
e@0 19 y = 0.5*sin(2*pi*f0*t)
e@0 20
e@0 21
e@0 22 player = pyaudio.PyAudio()
e@0 23 stream = player.open(format=pyaudio.paFloat32, channels=1,rate=SR,output=True)
e@0 24
e@0 25 stream.start_stream()
e@0 26 stream.write(y)
e@0 27 stream.close()
e@0 28
e@0 29 #plot(t, y)