speech-recognition

How to set the language in speech recognition on android?

青春壹個敷衍的年華 提交于 2019-12-17 05:48:46
问题 I've been working on speech Recognition API in android and found out that the speech results vary allot when the language settings are changed , is there a way to set it programmatically ? or is there an intent to lunch the speech language settings screen ? or what else ? note: I tried to use this intent extra: intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, "en-US"); but it was ineffective 回答1: As pargat says, this will do it: intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, "en

Android Speech Recognition Continuous Service

笑着哭i 提交于 2019-12-17 04:52:37
问题 I'm trying to create a service to run continuous speech recognition in Android 4.2. Using the answer from this link ( Android Speech Recognition as a service on Android 4.1 & 4.2 ), I created a service that is run from an Activity. My problem is that I get null exceptions when accessing mTarget.mAudioManager or mTarget.mSpeechRecognizerIntent in the handleMessage method. The target (and mTarget object created from it) is not null , but all the objects inside it are. What am I doing wrong here

Android Speech Recognition Continuous Service

风格不统一 提交于 2019-12-17 04:49:06
问题 I'm trying to create a service to run continuous speech recognition in Android 4.2. Using the answer from this link ( Android Speech Recognition as a service on Android 4.1 & 4.2 ), I created a service that is run from an Activity. My problem is that I get null exceptions when accessing mTarget.mAudioManager or mTarget.mSpeechRecognizerIntent in the handleMessage method. The target (and mTarget object created from it) is not null , but all the objects inside it are. What am I doing wrong here

Google Speech Recognition API Result is Empty

回眸只為那壹抹淺笑 提交于 2019-12-17 02:49:21
问题 I'm performing an asynchronous request to Google Cloud Speech API, and I do not know how to get the result of operation: Request POST: https://speech.googleapis.com/v1beta1/speech:asyncrecognize Body: { "config":{ "languageCode" : "pt-BR", "encoding" : "LINEAR16", "sampleRate" : 16000 }, "audio":{ "uri":"gs://bucket/audio.flac" } } Which returns: { "name": "469432517" } So, I do a POST: https://speech.googleapis.com/v1beta1/operations/469432517 Which returns: { "name": "469432517", "metadata"

Voice recognition on android with recorded sound clip?

怎甘沉沦 提交于 2019-12-17 02:31:06
问题 I've used the voice recognition feature on Android and I love it. It's one of my customers' most praised features. However, the format is somewhat restrictive. You have to call the recognizer intent, have it send the recording for transcription to google, and wait for the text back. Some of my ideas would require recording the audio within my app and then sending the clip to google for transcription. Is there any way I can send an audio clip to be processed with speech to text? 回答1: I got a

Detect silence when recording

末鹿安然 提交于 2019-12-17 02:22:36
问题 How can I detect silence when recording operation is started in Java? What is PCM data? How can I calculate PCM data in Java? I found the solution : package bemukan.voiceRecognition.speechToText; import javax.sound.sampled.*; import java.io.*; public class RecordAudio { private File audioFile; protected boolean running; private ByteArrayOutputStream out; private AudioInputStream inputStream; final static float MAX_8_BITS_SIGNED = Byte.MAX_VALUE; final static float MAX_8_BITS_UNSIGNED = 0xff;

How can I use speech recognition without the annoying dialog in android phones

夙愿已清 提交于 2019-12-16 20:02:44
问题 Is this possible without modify the android APIs? I've found a article about this. There's one a comment that I should do modifications to the android APIs. But it didn't say how to do the modification. Can anybody give me some suggestions on how to do that? Thanks! I've found this article; SpeechRecognizer His needs is almost the same as mine. It is a good reference for me! I've totally got this problem solved. I googled a usable sample code from this China website Here's my source code

How can I use speech recognition without the annoying dialog in android phones

核能气质少年 提交于 2019-12-16 20:01:26
问题 Is this possible without modify the android APIs? I've found a article about this. There's one a comment that I should do modifications to the android APIs. But it didn't say how to do the modification. Can anybody give me some suggestions on how to do that? Thanks! I've found this article; SpeechRecognizer His needs is almost the same as mine. It is a good reference for me! I've totally got this problem solved. I googled a usable sample code from this China website Here's my source code

Speaker recognition - Bad Request error on microsoft oxford

女生的网名这么多〃 提交于 2019-12-14 04:12:55
问题 I am using the python wrapper that has been given in the SDK section. I've been trying to enroll a voice file for a created profile using the python API. I was able to create a profile and list all profiles successfully. But when I try to enroll a voice (.wav) file with a simple hello world phrase with the created profile, I get the error 'ERROR:root:Error enrolling profile.' which in the trace tells 'Exception: Error enrolling profile: Bad Request' . I've used by importing the module to my

Python, speech_recognition tool does not recognize .wav file

我只是一个虾纸丫 提交于 2019-12-14 02:06:55
问题 I have generated a .wav audio file containing some speech with some other interference speech in the background. This code worked for me for a test .wav file: import speech_recognition as sr r = sr.Recognizer() with sr.WavFile(wav_path) as source: audio = r.record(source) text = r.recognize_google(audio) If I use my .wav file, I get the following error: ValueError: Audio file could not be read as PCM WAV, AIFF/AIFF-C, or Native FLAC; check if file is corrupted or in another format The