Open singalen opened 7 years ago
Yes, I can confirm this, music often skips and the playback is not as smooth as the desktop version.
Looks like SDL_mixer doesn't use iOS acceleration: https://hg.libsdl.org/SDL_mixer/file/d98f1d930524
File substitution-wise, here's the trick: in sound.cpp
, load_chunk()
, see and hack get_binary_file_location()
. Transparent change that doesn't require changes all over cfg
s, just put mp3-s in instead:
// mp3-s are hardware-accelerated on iOS.
if(type == "sound" && ends_with(filename, ".ogg")) {
std::string ogg_converted = path(filename).replace_extension(".mp3").string();
std::string converted = get_binary_file_location(type, ogg_converted);
if(!converted.empty()) {
return converted;
}
}
But then, play_sound_internal()
needs to be modified to use iOS' hardware:
Or maybe make a patch for SDL_mixer.
This will have to wait.
A possible code to do it, MIT licensed: https://github.com/sbooth/SFBAudioEngine/blob/master/Output/CoreAudioOutput.cpp. Some more can be googled up by "CoreAudio c++ github"
Convert game music to mp3, this will enable hardware-accelerated playback. Verify that it's used in SDL.