So I have an app which plays many short sound clips. I need to know when the sounds are finished playing, and I need to use mp3s, so I\'m using AVFoundation for the sound playb
Turns out this can be accomplished by allocating an AVAudioPlayer
with any valid sound file and calling the prepareToPlay
method, without ever calling the play
method.
Works perfectly.
so you want to disable ringer playback volume as long as the app is running? therefore the hardware controls will only adjust the app playback sounds?
i dont think this is possible unless you are "always playing sound" for example, many games are always playing background music or what have you.
You might be able to accomplish this by constantly playing a 0 volume sound as long as your app is running. You could then play your sound clips over it.
Start an AudioSession and don't stop it when you're not playing sounds.