I want to write a program in Python which plays random music. Is there any library that can directly play a sound of the given pitch or frequency, during the given time? For example, play(440, 4)
should play the note A during 4 seconds.
I've found some libraries that can do what I said, but they don't play the music directly: you have to create a .wav
file and, then, play this file. If I don't find any library that does what I want, I'll create a file, play it, and remove it for each note, but I think it would be more easy to do it directly.