我被困在我的离线 Android 应用程序之一中,在那里我需要离线语音识别和语音到文本 API。
如果有人从事过离线语音到文本和语音识别,请分享您的观点和意见。
我在StackOverFlow上搜索了很多有关此问题的内容,但是这些线程的使用时间已超过3年。
我实现了Google Voice Recognition,需要Internet连接。搜索如何使用我Offline Voice Recognition不会带来成功。
现在可以Voice Recognition离线使用吗?
我的代码到目前为止:
speechStartButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
promtSpeechInput();
}
});
private void promtSpeechInput() {
Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, Locale.getDefault());
intent.putExtra(RecognizerIntent.EXTRA_PROMPT,
"Recording...");
try {
startActivityForResult(intent, REQ_CODE_SPEECH_INPUT);
} catch (ActivityNotFoundException e) {
Toast.makeText(getApplicationContext(), "Language not supported", Toast.LENGTH_SHORT).show();
}
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case CAMERA_PIC_REQUEST: {
try {
Bitmap image …Run Code Online (Sandbox Code Playgroud) 下面是我的代码.我无法听到我的kitkat设备中的声音.播放出现但声音没有播放.我正在按照本教程
https://www.tutorialspoint.com/android/android_text_to_speech.htm
package com.example.insert;
import android.os.Parcelable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.app.Activity;
import android.os.Bundle;
import android.speech.tts.TextToSpeech;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import java.util.Locale;
import android.widget.Toast;
import android.util.Log;
import java.lang.Object;
public class SecondActivity extends AppCompatActivity {
TextToSpeech t1;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);
String emailid;
emailid = "Hi,say your email id";
t1 = new TextToSpeech(getApplicationContext(), new TextToSpeech.OnInitListener() {
@Override
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
int result = t1.setLanguage(Locale.US);
if (result == TextToSpeech.LANG_MISSING_DATA …Run Code Online (Sandbox Code Playgroud) android speech-recognition text-to-speech voice-recognition google-text-to-speech
我做了一个简单的UWP应用程序来测试语音识别功能,但我有一些错误,它显示:
System.UnauthorizedAccessException:“访问被拒绝。(HRESULT 异常:0x80070005 (E_ACCESSDENIED))'
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
SpeechRecognizer recognizer = new SpeechRecognizer();
private async void Record_Click(object sender, RoutedEventArgs e)
{
var topUserLanguage = GlobalizationPreferences.Languages[0];
var language = new Language(topUserLanguage);
recognizer = new SpeechRecognizer(language);
await recognizer.CompileConstraintsAsync();
recognizer.Timeouts.InitialSilenceTimeout = TimeSpan.FromDays(1);
var recordResult = await this.recognizer.RecognizeAsync();
result.Text = recordResult.Text;
}
}
Run Code Online (Sandbox Code Playgroud) 使用 LIUM Speaker Diarization 工具包,我如何知道哪个演讲者发言了多长时间?
例如,这是我的 .seg 文件。
;; cluster S0 [ score:FS = -33.93166562542459 ] [ score:FT =
-34.24966646974656 ] [ score:MS = -34.05223781565528 ] [ score:MT =
-34.32834794609819 ]
Seq06 1 0 237 F S U S0
Seq06 1 2960 278 F S U S0
;; cluster S1 [ score:FS = -33.33289449700619 ] [ score:FT =
-33.64489165914674 ] [ score:MS = -32.71833169822944 ] [ score:MT =
-33.380835069917275 ]
Seq06 1 238 594 M S U S1
Seq06 1 …Run Code Online (Sandbox Code Playgroud) 我正在创建一个Web应用程序,用户应通过语音识别作为密码注册应用程序.声音应该被认可用于授权.有没有办法通过Java语言实现语音识别?
PS:如果用户提供语音,则语音应该能够通过已存储的语音识别并能够登录应用程序.
我对音频信号很陌生。我们这里使用的值 32768 是多少?
示例代码:
rate, data = wavfile.read(wav_loc)
data = data / 32768
Run Code Online (Sandbox Code Playgroud) python voice audio-recording voice-recognition noise-reduction
在Android应用中,如何显示系统语音识别设置屏幕?
注意:这里有一个类似的问题,但它已经过时了.
我之前正在思考这个问题.现代算法(特别是那些将语音转换为文本的算法)用来确定说哪个同音异义词(例如,也是,或两个?)
他们是否使用情境线索?句子的结构?也许还有每个字平常发音的方式略有差别(例如,我通常持有邻声长2比对).前两者的组合似乎最合理.
我已经按照官方文档中的确切步骤进行操作,但仍然无法让我的应用程序开始使用自定义语音命令.遵循的步骤是:
1在strings.xml中为自定义语音命令添加新的字符串资源:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Hello World!</string>
<string name="glass_voice_trigger">start example</string>
</resources>
2为语音启动定义创建新的XML文件:
<?xml version="1.0" encoding="utf-8"?>
<trigger keyword="@string/glass_voice_trigger" />
Run Code Online (Sandbox Code Playgroud)
3在AndroidManifest.xml中请求适当的权限:
<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />
Run Code Online (Sandbox Code Playgroud)
4清单部分如下:
<service
android:name="pl.infoshare.sample.helloworld.HelloWorldService"
android:icon="@drawable/ic_lap"
android:label="@string/app_name"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="com.google.android.glass.action.VOICE_TRIGGER" />
</intent-filter>
<meta-data
android:name="com.google.android.glass.VoiceTrigger"
android:resource="@xml/voice_trigger_start" />
</service>
Run Code Online (Sandbox Code Playgroud)
不过,我无法使用语音命令启动应用程序.如果我更改为其中一个预定义的语音命令,应用程序会显示在时间轴上,我可以使用语音命令启动它.我错过了什么吗?
android ×4
voice ×3
java ×2
google-gdk ×1
google-glass ×1
offlineapps ×1
python ×1
speech ×1
uwp ×1