B4A Library [Chargeable] SpeechRecognizer Library

SpeechRecognizer




I have received a lot of requests lately for my SpeechRecognizer library.
This is why I made a separate topic for SpeechRecognizer.
With SpeechRecognizer, you'll be able to recognize text from a service! No popups or anything else!

A2ae6l.png


Requirements:
- Android 2.1+ (API 8)



What will you get from me:
- The library files
- A sample project
- A readme file. (Disclaimer.)


Payment

The price of the library is 15 Euros.
Payment is done through PayPal.
If you are interested in the library, you can send me a private message here on the forums or send me an email to [email protected].

Sample

You can find a sample here written by NJDude:
http://www.b4x.com/forum/android-job-offers/21512-freelance-library-development-6.html#post134332


Special thanks and credits goes to NJDude for the sample.

Kind regards,
Tomas
 
Last edited:

mrodriguez

Member
Licensed User
Longtime User
Hi, I need to use google voice recognition over rikomagic.
Rikomagic use android 4.1 but doesnt have the voice recognition software and can not install it from play store.

So my only way is to use the unofficial voice recognition api from google.
https://gist.github.com/alotaiba/1730160

The proccess is ver simplye:
I send a post to https://www.google.com/speech-api/v1/recognize with the recorded file (using audiorecorder b4a library), and the respose is an json with the text.

Question:
Are you using that for your SpeechRecognizer Library?
If not, are you using the android voice recognition software?

Thanks
 

Harris

Expert
Licensed User
Longtime User
Works perfect!!!

Great! Do you have a code example?

This is my project:
User is "out in the field" without network coverage.
Since his hands are covered with bee wax and honey, he needs to make a notation of the conditions of the yard (voice recording without typing).
When he returns to network coverage, the file (voice recording) is processed (as you stated above) and the text record returned added to the DB.

Make Sense? Doable?

Thanks
 

mrodriguez

Member
Licensed User
Longtime User
If you want to do it off-line, with a recorded file, you can buy a 3D usb audio and with a cable connect MIC to HEAD (back to back) and then play a file.
At the same time you recognize speech using Tomas Library (speechrecognizer)
3D audio usb:
Regards
 

mrodriguez

Member
Licensed User
Longtime User
Great! Do you have a code example?

This is my project:
User is "out in the field" without network coverage.
Since his hands are covered with bee wax and honey, he needs to make a notation of the conditions of the yard (voice recording without typing).
When he returns to network coverage, the file (voice recording) is processed (as you stated above) and the text record returned added to the DB.

Make Sense? Doable?

Thanks

Next post my reply
 

Harris

Expert
Licensed User
Longtime User
I see...
I was hoping I could "feed" speech recognizer with a saved audio file and get text results.

Tomas, can this be accomplished?

Thanks
 

RichyK68

Active Member
Licensed User
Longtime User
What audio format do you record the voice in? I've been trying this technique but Google keeps telling me the format is not recognized.


Hi, I need to use google voice recognition over rikomagic.
Rikomagic use android 4.1 but doesnt have the voice recognition software and can not install it from play store.

So my only way is to use the unofficial voice recognition api from google.
https://gist.github.com/alotaiba/1730160

The proccess is ver simplye:
I send a post to https://www.google.com/speech-api/v1/recognize with the recorded file (using audiorecorder b4a library), and the respose is an json with the text.

Question:
Are you using that for your SpeechRecognizer Library?
If not, are you using the android voice recognition software?

Thanks
 

RichyK68

Active Member
Licensed User
Longtime User
Sorry, the actual message I get back from the post is Content-Type media type is not audio
 

mrodriguez

Member
Licensed User
Longtime User
Rick, Tomas ( XverhelstX ) sell the library and examples of the SpeechRecognizer api.
I can´t send you the SpeechRecognizer library because of the Tomas´s license.
Also it just cost 10 euros. Contact Tomas to buy it.
Regards
 

petr4ppc

Well-Known Member
Licensed User
Longtime User
Tomas, please, I am playing with your lib and I have recognized, that when I start STARTLISTENING for example 5 times in one minute, then I get Error=8

Then if I push again the button STARTLISTENING, the listening is not starting......I must close and reopen app or I must reinstall it

please for your advice
 

wimpie3

Well-Known Member
Licensed User
Longtime User
How can we specify a language?

The Android docs suggest the following:
B4X:
    String languagePref = "de";//OR, whatever iso code...
    Intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, languagePref);
    Intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, languagePref); 
    Intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, languagePref);

But how do we do this in your library?
 

brelto85

Active Member
Licensed User
Longtime User
How can we specify a language?

The Android docs suggest the following:
B4X:
    String languagePref = "de";//OR, whatever iso code...
    Intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, languagePref);
    Intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, languagePref);
    Intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, languagePref);

But how do we do this in your library?

same question...
 

XverhelstX

Well-Known Member
Licensed User
Longtime User
I just bought this library. It works very well. Regrettably only the default language is supported. However, XverhelstX has been very helpful by providing some source code to add other languages. I have asked him to include it in his library because it is not b4A code (it uses Google API code). I don't know yet whether I will be able to implement it in order to add other languages. The library also does not have any VU audio meter code. This is really a pity because intercepting "rms" events is extremely simple. To do so, modify the provided BAS file:

B4X:
'Rms has changed
Sub SpeechRecognition_RmsChanged (rms AsFloat)
  Log("RMS: " & rms)
  CallSub2(Main, "ShowVU", rms)
End Sub

And add a routine to main:

B4X:
Sub ShowVU(rms AsFloat)
  Dim VUlevel1 as Int
  VULevel1 = rms * 10
  'etc....
End Sub


It is impossible to add every single detail to the SpeechRecognizer library because there can be many variable solutions.
However, it should be very easy to implement your own language, and other actions by using the RecognizerIntent constants which can be found here:
http://developer.android.com/reference/android/speech/RecognizerIntent.html

All you have to do is create your own B4A intent, set up the required parameters with the constants and pass it to the SpeechRecognizer instance. This has been supported from the start already. My apologies if it wasn't so clear for some users.

An example:

B4X:
Sub StartListening  
  Dim i AsIntent
  i.Initialize("android.speech.action.RECOGNIZE_SPEECH", "")
  i.PutExtra("android.speech.extra.LANGUAGE_MODEL", "free_form")
  i.PutExtra("calling_package", "your package name")
  i.PutExtra("android.speech.extra.MAX_RESULTS", 5)
  i.PutExtra("android.speech.extra.LANGUAGE", "en-US")
  sr.StartListening(sr.CreateRecognizeIntent2(i))
End Sub

About the VU meter, this is the task of the developer of the application to implement it, and not the library developer.
SpeechRecognizer raises the event so the developer can use it and implement their own features, like a VU meter, etc

I hope everything is clear now, and if there are still questions, feel free to pm me or ask on the topic.

Kind regards,
Tomas
 

brelto85

Active Member
Licensed User
Longtime User
The CreateRecognizeIntent2 method there isn't in SpeechRecognizer library
is a method that should be created by author or by us?
How to do this?
 

brelto85

Active Member
Licensed User
Longtime User
Unfortunately I have ran into a problem with the speechrecognizer on a HTC smartphone. Some of my customers are starting to report this problem as well. The microphone is so sensitive that background noise is easily picked up. Regrettably the AGC (Automatic Gain Control) increases the microphone's sensitivity as soon as the user has finished speeking. The recognizer believes the increasing background noise to be speech and therefore the SpeechRecognition_EndOfSpeech event is fired too late or not even at all (the recogniser then times-out). This problem can be witnessed by following the SpeechRecognition_RMSchanged event that clearly shows the microphone volume in relation to the background noise (on a Nexus-7 everything is fine).
This problem does not occur while using B4A's default VoiceRecognizer (VR). How to solve this problem?
I was thinking of:
1. Finding a way to controle the AGC by software (but that is risky because it would be device-dependent).
2. Permanently reducing the microphone's sensitivity (ditto risky)
3. Activating a low-pass audiofilter (if possible) to reduce the pickup of noise.
4. Reducing the silence listening time with:
i.PutExtra("android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS",500)
However, so far this has been unsuccesfull because silence is not properly detected.
5. Finding out how Google has overcome this problem.

Any thoughts?

I've an HTC phone and since i implemented the CreateRecognizeIntent2 method i have the same behaviors
Is very important for me resolve this issue
I don't tried the SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS extra

I expect a reply from Tomas
 
Top