Alright, so I have been working on the audio player, using pyglet's media module, and have come to the conclusion that it is insufficient for what we need.
- First and foremost (I should have looked into this sooner), MIDI is not a supported format, neither through pyglet, nor AVbin.
- I *think* in order for AVbin to play, you need to first start the pyglet loop with "pyglet.app.run()", which we cannot do obviously, we are using wxPython.
- It basically requires a hack to have events fire properly. Normally, "dispath_events()", which must be called regularly to have events you have binded actually fire, is called via the pyglet app's loop. I already had to make a wxTimer to handle updating for such a minor thing that is handled better in other audio add-ons.
- Playback is often times very buggy, especially when files are paused, then restarted.
- I really wanted to have an audio module that better supported reading raw data a little better that I could convert easily into numpy arrays. The reason for this is I planned on implementing a simple spectrogram to provide a visual representation of the stream. Most other audio modules make this conversion relatively simple to do, even pygame's built in audio module, but pyglet lacks any clean way of doing this.
I have been looking into some other modules, but all seem to have a few pros and cons. Here's a a quick summary of a few I found so far.
PyGame.Mixer moduleHas the easiest way of converting data to numpy arrays with its sndarray function. Has seek/volume functions, and supports all the file formats that we plan to utilize, and is pretty easy to use. The only real con is missing support of changing pitch. This can still be done by manipulating the arrays, though something a bit cleaner would be nice. If changing pitch gets dropped for the engine, this won't be a ordeal at all.
AudioLabProbably has the most amount of actual function, most of which we won't be using. Biggest drawback is that it is an addon to a SciPy, which is quite q large package that would also need to be included. The current version is only 0.1, so it is also rather immature, though in practice, it seems to work pretty well.
PyAudiereA rather immature audio module. It really doesn't offer much of anything over the previous two.
PyAudioA wrapper for PortAudio, a cross-platform audio library. I haven't looked as deep into this one, so I don't have much to say about it yet.
If you can't tell by my descriptions, I am leaning towards PyGame as the player of choice.Here is a screenshot of what I had for the audio player.
The spectrograph is copy-paste edit, but it will look very similar with a quick plot using matplotlib