语音(来自具有PCM音频数据的wav音频文件)到IOS中的文本识别API?

时间:2013-07-02 03:32:10

标签: ios speech-recognition speech-to-text

是语音识别的新手。我能够将语音(从设备麦克风录制)转换为文本使用某些API,如ispeech,openers,&等等。

但我找不到将音频wav文件转换为文本的任何API。我认为,可以通过文件共享来支持一些外部服务器(java)。但我喜欢不使用互联网。有没有可用于IOS的API ???

1 个答案:

答案 0 :(得分:0)

看看开放式耳朵演示样本并看到了这样,是的,可以用耳朵打开

- (void) startListening {

// startListeningWithLanguageModelAtPath:dictionaryAtPath:languageModelIsJSGF always needs to know the grammar file being used,
// the dictionary file being used, and whether the grammar is a JSGF. You must put in the correct value for languageModelIsJSGF.
// Inside of a single recognition loop, you can only use JSGF grammars or ARPA grammars, you can't switch between the two types.

// An ARPA grammar is the kind with a .languagemodel or .DMP file, and a JSGF grammar is the kind with a .gram file.

// If you wanted to just perform recognition on an isolated wav file for testing, you could do it as follows:

// NSString *wavPath = [NSString stringWithFormat:@"%@/%@",[[NSBundle mainBundle] resourcePath], @"test.wav"];
//[self.pocketsphinxController runRecognitionOnWavFileAtPath:wavPath usingLanguageModelAtPath:self.pathToGrammarToStartAppWith dictionaryAtPath:self.pathToDictionaryToStartAppWith languageModelIsJSGF:FALSE];  // Starts the recognition loop.

// But under normal circumstances you'll probably want to do continuous recognition as follows:

[self.pocketsphinxController startListeningWithLanguageModelAtPath:self.pathToGrammarToStartAppWith dictionaryAtPath:self.pathToDictionaryToStartAppWith languageModelIsJSGF:FALSE];


}
相关问题