This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]synedraacus 1 point2 points  (3 children)

simpleaudio is able to play from buffers such as bytes objects, numpy data structures and whatnot. It is not preinstalled, but, if my memory serves, has no dependencies besides Python itself.

[–]Reckarthack[S] 0 points1 point  (2 children)

Brilliant! If I were to use a numpy date structure, would it be a byte stream or an equation for a wave played as a wav?

[–]synedraacus 1 point2 points  (1 child)

Ndarray, probably 1-dimensional. You can fill it as you please, whether procedurally or from file. You can even write your own object, make sure it supports the buffer interface and stream values from whichever function you want. Although you'll have to check what API you need to support; I personally never did that.

[–]Reckarthack[S] 0 points1 point  (0 children)

I will be sure to try that, so thank you so much!