我的需求是在后台为UILocalNotification警报体启用TTS(文本到语音)。以便系统在显示相应通知的同时读取预警正文。
提前谢谢你。
发布于 2015-07-09 14:03:18
当您的本地通知进入您的前台应用程序时,您可以执行以下操作:
AVSpeechUtterance *utterance = [AVSpeechUtterance
speechUtteranceWithString:@"Replace this sentence with contents of local notification"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
我不确定当应用程序在后台,用户看不见的时候,合成器是否可以使用。
关于这一点的更多细节可以在this related question中找到。
https://stackoverflow.com/questions/31308664
复制相似问题