You must use the library. Writing all this in pure python can be many thousands of lines of code to interact with audio equipment!
With a library, for example. audiere, it will be so simple:
import audiere ds = audiere.open_device() os = ds.open_array(input_array, 44100) os.play()
There is also a piglet, pygame and many others.
source share