I know that OpenAL is fast library but it doesn't support any compressed audio format and it's not so easy to use...
AVAudioPlayer is not so fast, but supports wide range file formats, as well as compressed formats like mp3.
Also there is an SKAction class which can play a sound, as well as SystemSoundID...
I have few questions:
What would be a preferred way/player/technique to play :
Also, is it smart move to use uncompressed audio for sound effects? I suppose this is ok, because those files have small size anyway?
I'm personally using ObjectAL. It's good because it utilizes OpenAL and AVAudioPlayer but abstracts a lot of the complicated parts away from you. My game has background music, tons of sounds playing simultaneously, and loopable sounds that increase in volume, pitch etc based on a sprites speed. ObjectAL can do all of that.
ObjectAL can be used for playing simple sounds and music loops using it's OALSimpleAudio class. Or you can get deeper into it and do more complex things.
I've created a simple wrapper around ObjectAL specifically for my game so it's further abstracted away from me.
From what I've read, uncompressed audio is better. You just need to make sure you preload the sounds so that your game isnt trying to pull the file each time it's playing a sound.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With