If native processing is acceptable, iOS has exactly the API otherAudioPlaying since iOS 6.
AudioSessionGetProperty
can be retrieved by specifying kAudioSessionProperty_OtherAudioIsPlaying
in AudioSessionGetProperty
.Actually used in cocos2d-x
© 2024 OneMinuteCode. All rights reserved.