Custom Bonbons
Custom Bonbons

Reputation: 1699

Alternative to deprecated AudioSessionGetProperty, for iOS 7

I am using AudioSessionGetProperty to check 'audioIsAlreadyPlaying'. Xcode says: 'AudioSessionGetProperty' is deprecated: first deprecated in iOS 7.0

Please could someone tell me what I should use instead, to get the audioIsAlreadyPlaying property.

AudioSessionGetProperty(kAudioSessionProperty_OtherAudioIsPlaying,
                        &propertySize,
                        &audioIsAlreadyPlaying);
return audioIsAlreadyPlaying;

Upvotes: 18

Views: 16479

Answers (2)

rickster
rickster

Reputation: 126137

The AVAudioSession class replaces deprecated AudioSession APIs. For what you're doing, see the otherAudioPlaying property.

Upvotes: 1

Ben S
Ben S

Reputation: 69342

Trying using the AVAudioSession's otherAudioPlaying property on iOS 6.0 or higher.

[[AVAudioSession sharedInstance] isOtherAudioPlaying]

Upvotes: 43

Related Questions