It’s been years since I experimented with wx.MediaCtrl, but I know it used to playback MP3s on Windows. I tried updating my old MP3 player code to the latest wxPython (4.1.1) but now it doesn’t work and there are no errors.
I am attaching my code. Could someone tell me what I’m doing wrong? Note, I am using Python 3.9 on MacOS Mojave.
Okay, I peeked. I said I wouldn’t until later, but I did.
Your code doesn't work on either macOS Catalina or Windows 10.
When I press your “Play” button, your “on_play” method is not
invoked. That is why you don’t hear anything.
I added "self.media_ctrl.Play()" to your loadMusic method and the
file started playing on macOS but not WIndows. This suggests to
me that the problem is in your buttons and event handlers, not in
the MediaCtrl per se.
I'd have to dig more into my own code to see about the failure of
the wx.EVT_MEDIA_LOADED event on Windows, which I can confirm in
your code, and I truly don’t have time to do that right now.
I got it working on my Mac. I haven’t had a chance to try it again on Windows though. My current issue is that when I go to skip a track, the playback slider stops updating. But if I pause or stop the track and then hit play again, the slider starts updating again.
I really don’t know why. The skip method I wrote calls the stop method before doing anything else, so you would think that stopping and starting would be no different than skipping.
I added ObjectListView and eyeD3 to the mix so I can load the MP3 tags and display what songs are in my play list.