Skip to content

Commit e0e4e8b

Browse files
Merge pull request #267 from runna-app/master
2 parents eb07e37 + 01f42fe commit e0e4e8b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ios/TextToSpeech/TextToSpeech.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ + (BOOL)requiresMainQueueSetup
7979
}
8080

8181
if([_ignoreSilentSwitch isEqualToString:@"ignore"]) {
82-
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
82+
[[AVAudioSession sharedInstance]
83+
setCategory:AVAudioSessionCategoryPlayback
84+
mode:AVAudioSessionModeVoicePrompt
85+
// This will pause a spoken audio like podcast or audiobook and duck the volume for music
86+
options:AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers
87+
error:nil
88+
];
8389
} else if([_ignoreSilentSwitch isEqualToString:@"obey"]) {
8490
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
8591
}

0 commit comments

Comments
 (0)