Feature
Add support for "ducking" and "unducking" the iOS audio session. The SDK doesn't expose this right now, but it can very easily.
An example of ducking is when the GPS lowers other sounds to say something, then raises them after it is done speaking.
Proposed Solution
Expose "Ti.Media.ducking = true /* or false */;". Something like the following:
In TiMediaAudioSession.m:
-(void)setDucking:(UInt32)mode
{
if ([self isActive]) {
DebugLog(@"[WARN] Setting ducking while playing audio... changes will not take effect until audio is restarted.");
}
AudioSessionSetProperty(kAudioSessionProperty_OtherMixableAudioShouldDuck,sizeof(mode),&mode);
}
And in MediaModule.m:
-(void)setDucking:(NSNumber*)mode
{
[[TiMediaAudioSession sharedSession] setDucking:[mode unsignedIntValue]];
}
Apple Documentation
Apple talks about this feature in the last paragraph on this page:
http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/Configuration/Configuration.html
Yes, Please allow more flexibility with regards to iOS audio session options like AVAudioSessionCategoryOptionMixWithOthers and AVAudioSessionCategoryOptionDuckOthers.