zulooipad.blogg.se

Soundation audio locker
Soundation audio locker











soundation audio locker soundation audio locker

Status = AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (sessionCategory), &sessionCategory) UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback

soundation audio locker

We want our audio to play if the screen is locked or the mute switch is on OSStatus status = AudioSessionInitialize(NULL, NULL, NULL, NULL) in the implementation: - (void)viewDidLoad MPMusicPlayerController (nonatomic, retain) IBOutlet UIButton (nonatomic, retain) IBOutlet UIButton (nonatomic, retain) MPMusicPlayerController *musicPlayerController #import MusicPlayerVolumeTestViewController : UIViewController So I've set up a simple test case to reproduce this. Playing the AVAudioPlayer does not have any affect on the audio level. In fact, what I see (or hear, rather) is that if I setup the AudioSession with kAudioSessionProperty_OtherMixableAudioShouldDuck set to true, the MPAudioPlayerController initial volume gets reduced, and if I then call pause (and then play again) on the MPAudioPlayerController the volume level gets increased to "normal" levels. When ducking takes place, all other audio on the device-apart from phone audio-lowers in volume.īut I'm not seeing this behavior. Say the user is exercising along to their iPod when your application wants to overlay a verbal message-for instance, “You’ve been rowing for 10 minutes.” To ensure that the message from your application is intelligible, apply the kAudioSessionProperty_OtherMixableAudioShouldDuck property to the audio session. This could be used, for example, in an exercise application. Specifically:įinally, you can enhance a category to automatically lower the volume of other audio when your audio is playing. I've an app which uses the MPAudioPlayerController to access the iPod music library, and an AVAudioPlayer to overlay audio on top of the music.













Soundation audio locker