Issues playing .ogg exported by MuseScore 4

Hi! I’m playing around with adding music to my roguelike, and have been using SDL for the playback. So far so good: I’m able to load sound effects as WAVs, play them back, play music via MP3, etc.

I want to use Ogg Vorbis for the format, so I’ve been playing around with a few ideas in a few software packages. I created a chiptune in FamiStudio and was able to export this as an .ogg and play this back successfully in-game. Next, I tried exporting an .ogg from MuseScore 4. This didn’t play in my game (I got silence, and after investigating, noticed that the Mix_Music* is null), though I was able to play it fine with VLC Player. I tried a few other MuseScore scores: MP3s were fine in-game, OGGs were fine in VLC but not via SDL.

I’ve been trying to narrow down the issue. The MP3s exported by MuseScore play back fine in game. As for the problematic .oggs, when I call Mix_GetError(), I get an error about “vorbis_invalid_first_page”.

Here’s a sample file that demonstrates the issue for me. Is there some additional setup or something I need to do in SDL? I’m not sure if this is an SDL issue, a MuseScore issue, or what, but because I was able to play it in VLC Player, I thought I’d try starting here. I’m using SDL 2.0.20 under Windows.


Seems like MuseScore is exporting the Ogg file in a way that SDL_Mixer’s Ogg Vorbis support doesn’t like.

Can you export to WAV and then use something like Audacity to convert to Ogg Vorbis?

Yup, that works well. An extra step, but it’s not like it’s something I have to do often. Just did a quick attempt in Audacity, worked as expected.