gpt4 book ai didi

ios - 语音识别在 iOS 上出现错误

转载 作者:可可西里 更新时间:2023-11-01 03:07:58 25 4
gpt4 key购买 nike

我正在研究iOS上的语音识别,但是每次调用[_recognitionRequest endAudio]方法时,总是报错recognitionTaskWithRequest: the message is in the bottom。

-(void) stopRecording {
if (_disableSpeechSW == YES) {
return;
}
if (_isAuthorization == NO) {
return;
}

NSLog(@"stopRecording");

if ([_audioEngine isRunning]) {
[_audioEngine stop];
[_recognitionRequest endAudio];
}

-(void) startRecording {
..........
[_speechRecognizer recognitionTaskWithRequest:_recognitionRequest
resultHandler:^(SFSpeechRecognitionResult *result,NSError *error){
if (error != nil ) {
NSLog(@"%@",[error description]);
}
else {
..........
}
}];}

[Utility] +[AFAggregator logDictationFailedWithError:] Error Domain=kAFAssistantErrorDomain Code=203 "Retry" UserInfo={NSLocalizedDescription=Retry, NSUnderlyingError=0x17424c690 {Error Domain=SiriSpeechErrorDomain Code=1 "(null)"}}

最佳答案

有关 siri 语音限制的更多说明,请参阅此帖子:Speech Recognition Limits for iOS 10

Use my function below to stop speech recognization. Hope its works.

-(void)stopRecording{

dispatch_async(dispatch_get_main_queue(), ^{

if(audioEngine.isRunning){
[inputNode removeTapOnBus:0];
[inputNode reset];
[audioEngine stop];
[recognitionRequest endAudio];
[recognitionTask cancel];
recognitionTask = nil;
recognitionRequest = nil;
}
});
}

关于ios - 语音识别在 iOS 上出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39927727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com