Opened 17 months ago

Last modified 17 months ago

#18580 new defect

mediactrl won't play MIDI files on Macos when wxWidgets is built using AVFoundation but did with QTKit

Reported by: jon.warbrick Owned by:
Priority: normal Milestone:
Component: wxOSX Version: 3.1.3
Keywords: wxMediaCtrl MIDI regression Cc:
Blocked By: Blocking:
Patch: no


With wxWidgets 3.0.4 and 3.1.3 built on Macos 10.14 and 10.15, wxMediaCtr won't play MIDI files as demonstrated by the supplied mediaplayer sample. However a version of the library built on Macos 10.10 and supplied bundled with wxPython 4.0.6 does play MIDI files under Macos 10.14 though it won't play anything on Macos 10.15.

The bundled library appears to have been built using Apple's old, deprecated QTKit media interface. Builds under 10.14 and 10.15 necessarily use the newer AVFoundation interface.

While I can't entirely prove it, I strongly suspect the move from QTKit to AVFoundation has broken the ability to play MIDI files. This is a regression, and a significant problem for a program I'm trying to update to run on the latest versions of Macos.

Apple's documentation (see for example [1]) suggests that AVFoundation can play MIDI files, but perhaps not through the interface wxWidgets is using for everything else.

There has been some discussion of this on the forum [2].



Change History (1)

comment:1 Changed 17 months ago by vadz

  • Keywords wxMediaCtrl regression added; wxMediaCtr OSX removed

I have no experience with this, but it indeed looks like we need to use a separate AVMIDIPlayer and not AVPlayer at all to play MIDI files. I have no idea why is it so and whether we can somehow combine them together. In the worst case, we could just create both and use the appropriate one in Load() and other methods, even if this is a bit stupid.

BTW, I guess wxSound doesn't support MIDI neither, does it? It seems like it would be more appropriate to support MIDI in it rather than wxMediaPlayer.

Note: See TracTickets for help on using tickets.