2016-07-22 61 views

回答

2

这只有当字符串中的单个字符发生,

您可以使用此检查的解决方法,如果字符串的lenght为1比它转换为小写的字符串,

NSString *stringToUtter = @"A"; 
if (stringToUtter.length==1) { 
    stringToUtter = [stringToUtter lowercaseString]; 
} 
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:stringToUtter]; 
utterance.rate = AVSpeechUtteranceMinimumSpeechRate; 
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"en-us"]; 
[self.synthesizer speakUtterance:utterance]; 
+0

感谢you.its为我工作 –