2016-07-22 91 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爲我工作 –