Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
跟踪iOS 7 TTS中的语音_Ios_Objective C_Ios7_Text To Speech_Avspeechsynthesizer - Fatal编程技术网

跟踪iOS 7 TTS中的语音

跟踪iOS 7 TTS中的语音,ios,objective-c,ios7,text-to-speech,avspeechsynthesizer,Ios,Objective C,Ios7,Text To Speech,Avspeechsynthesizer,我想跟踪AvSpeechOutstance队列中的话语数。因此,我有多个字符串,它们将按照我设置的顺序被说出。有没有一种方法可以让我追踪说的是哪一个语音号码 假设我有10句话要说。我希望能够记录正在讲的是哪一个。因此,它应该记录以下内容:正在说话的话语6。有什么方法可以做到这一点吗?您可以使用avspeechsynthezerdelegate及其speechSynthesizer:didStartSpeechUtterance:方法。假设您将avspeechoutrance对象存储在名为outr

我想跟踪AvSpeechOutstance队列中的话语数。因此,我有多个字符串,它们将按照我设置的顺序被说出。有没有一种方法可以让我追踪说的是哪一个语音号码


假设我有10句话要说。我希望能够记录正在讲的是哪一个。因此,它应该记录以下内容:
正在说话的话语6
。有什么方法可以做到这一点吗?

您可以使用
avspeechsynthezerdelegate
及其
speechSynthesizer:didStartSpeechUtterance:
方法。假设您将
avspeechoutrance
对象存储在名为
outrances
NSArray
中:

- (void)speechSynthesizer:(AVSpeechSynthesizer *)synthesizer didStartSpeechUtterance:(AVSpeechUtterance *)utterance {
  NSUInteger utternanceNo = utterances indexOfObject:utterance];
  NSLog(@"Utterance %@ being spoken", @(utteranceNo));
}