我正在寻找一些可以让我在Android应用程序中创建离线语音识别的库.将为我的应用程序提供简单的词汇表,最多包含15个短(一个单词)命令.在我的情况下,响应时间至关重要.
有没有可行的离线选项(免费和付费)?我知道Sphinx的离线版本,但它是最快响应的选项(同样,我只需要我的应用程序识别几个命令而不是整个语音到文本功能)?
正如谷歌所说,新的android"果酱豆"将包含能够脱机工作的语音识别引擎.随着新的Android源代码的打开,我试着查看并找到语音识别引擎的来源,但没有成功.
所以我的问题:语音识别引擎源代码是android 4.1.1源代码的一部分吗?或者它就像是单独的应用程序?
提前致谢,对不起我的英语.
我有一个曾经工作过的代码,但由于某种原因它突然停止工作,我试图在希伯来语中使用语音识别,但似乎几天前它才开始用英语进行语音识别。
这是我的代码
sr = SpeechRecognizer.createSpeechRecognizer(getApplicationContext());
test_voice_recognitiona listener = new test_voice_recognitiona();
sr.setRecognitionListener(listener);
Intent fl = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
fl.putExtra("android.speech.extra.LANGUAGE", "he");
fl.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "he");
fl.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
this.getPackageName());
sr.startListening(fl);
Run Code Online (Sandbox Code Playgroud)
test_voice_recognitiona 是我的 RecognitionListener 类名。
代码运行良好,但出于某种原因,它一直在用英语收听。
我究竟做错了什么?
顺便说一下,我在谷歌对话框中尝试了更简单的代码,它正在工作。
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "he");
intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Talk to Me " + user_name);
startActivityForResult(intent,REQUEST_CODE);
Run Code Online (Sandbox Code Playgroud)
也许是谷歌现在更新错误
android speech-recognition voice-recognition recognizer-intent
我正在尝试使用 webrtcvad 2.0.8 进行语音活动检测。这个https://pypi.python.org/pypi/webrtcvad提供了基本程序。当我尝试按如下方式实现它时,出现错误。我的代码:
import webrtcvad
from scipy.io import wavfile
import scipy
source1 = path + "phone1.wav"
fs, audio = wavfile.read(source1)
audio_n = audio/float(2**15)
vad = webrtcvad.Vad(3)
def audioSlice(x, fs, framesz, hop):
framesamp = int(framesz*fs)
hopsamp = int(hop*fs)
X = scipy.array([x[i:i+framesamp] for i in range(0, len(x)-framesamp, hopsamp)])
return X
framesz=10./1000 #10 ms
hop = 1.0*framesz
Z = audioSlice(audio_n, fs, framesz, hop)
vad.is_speech(Z[100], fs)
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
is_speech(self, buf, sample_rate, length)
25 'buffer has %s frames, but length argument was %s' …Run Code Online (Sandbox Code Playgroud) 我想制作语音识别软件,但我不知道从哪里开始,我应该学习和使用哪些工具?我应该使用哪种编程语言?,构建该软件的步骤是什么.任何帮助,欢迎任何链接,任何想法.我搜索了书籍,但我没有发现任何...
提前致谢
我正在使用SppechRecognizer进行语音识别器应用程序.它的工作正常.我的要求是我希望在1秒或2秒后停止语音收听.怎么实现呢?
我正在开发一个总是从用户那里收听语音的Android应用程序.它在Sony X10i上运行时有效,但在三星Galaxy SII中不起作用.这是我的代码:
SpeechRecognizer speechRecognizer;
speechRecognizer = SpeechRecognizer.createSpeechRecognizer(getBaseContext());
MyRecognitionListener speechListner=new MyRecognitionListener();
speechRecognizer.setRecognitionListener(speechListner);
speechRecognizer.startListening(RecognizerIntent.getVoiceDetailsIntent(getApplicationContext()));
Run Code Online (Sandbox Code Playgroud)
这是我的听众课程:
class MyRecognitionListener implements RecognitionListener {
public void onBeginningOfSpeech() {
Log.d("leapkh", "onBeginningOfSpeech");
}
public void onBufferReceived(byte[] buffer) {
Log.d("leapkh", "onBufferReceived");
}
public void onEndOfSpeech() {
Log.d("leapkh", "onEndOfSpeech");
}
public void onError(int error) {
Log.d("leapkh", "onError");
}
public void onEvent(int eventType, Bundle params) {
Log.d("leapkh", "onEvent");
}
public void onPartialResults(Bundle partialResults) {
Log.d("leapkh", "onPartialResults");
}
public void onReadyForSpeech(Bundle params) {
Log.d("leapkh", "onReadyForSpeech");
}
public void onResults(Bundle results) { …Run Code Online (Sandbox Code Playgroud) 当我尝试处理我得到的flac文件时
"没有文件扩展名flac的处理程序"
错误.有没有办法在Windows中解决这个问题.
我有API Sphinx4的问题,我无法弄清楚为什么它不起作用.
我尝试写一个小类来捕获用户的声音并在文件上写下他的发言.
1)我在Eclispe上创建了一个新的java项目.
2)我创建了TranscriberDemo类.
3)我创建了一个文件夹"file".
4)我在文件夹"file"上复制文件夹"en-us"和文件"cmudict-en-us.dict","en-us.lm.dmp","10001-90210-01803.wav" .
5)我不使用maven,所以我只包含jar文件"sphinx4-core-1.0-SNAPSHOT.jar"和"sphinx4-data-1.0-SNAPSHOT.jar".
你可以在这里下载它们:
核心:https://1fichier.com/?f3y6vqupdr
数据:https://1fichier.com/?lpzz8jyerv
我知道源代码可用
这里:https://github.com/erka/sphinx-java-api
或者在这里:http://sourceforge.net/projects/cmusphinx/files/sphinx4
但我不使用maven所以我无法编译它们.
我的课:
import java.io.InputStream;
import edu.cmu.sphinx.api.Configuration;
import edu.cmu.sphinx.api.SpeechResult;
import edu.cmu.sphinx.api.StreamSpeechRecognizer;
import edu.cmu.sphinx.result.WordResult;
public class TranscriberDemo
{
public static void main(String[] args) throws Exception
{
System.out.println("Loading models...");
Configuration configuration = new Configuration();
// Load model from the jar
configuration.setAcousticModelPath("file:en-us");
configuration.setDictionaryPath("file:cmudict-en-us.dict");
configuration.setLanguageModelPath("file:en-us.lm.dmp");
StreamSpeechRecognizer recognizer = new StreamSpeechRecognizer(configuration);
InputStream stream = TranscriberDemo.class.getResourceAsStream("file:10001-90210-01803.wav");
stream.skip(44);
// Simple recognition …Run Code Online (Sandbox Code Playgroud) java speech-recognition speech-to-text voice-recognition sphinx4