B4A Library [Chargeable] SpeechRecognizer Library

XverhelstX

Well-Known Member
Licensed User
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!



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 rootsoftllc@gmail.com.

Sample

You can find a sample here written by NJDude:
http://www.basic4ppc.com/forum/andr...eelance-library-development-6.html#post134332


Special thanks and credits goes to NJDude for the sample.

Kind regards,
Tomas
 
Last edited:

mrodriguez

Member
Licensed 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
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
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
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
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
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
 

Rick Harris

Well-Known Member
Licensed 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.
Hello mrodriguez,
Would you be willing to share your B4A code with use to use the unofficial Google speech API?
 

mrodriguez

Member
Licensed 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

Active Member
Licensed 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
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
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...
 

Rick Harris

Well-Known Member
Licensed User
SpeechRecognizer


Hello Tomas
I wrote you an e-mail nearly a week ago. I am interested to buy your library, provided that it still works with Google voice and my other questions in my e-mail are answered. However, so far I received no reply. Do you still sell your Speech Library?

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!



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 rootsoftllc@gmail.com.

Sample

You can find a sample here written by NJDude:
http://www.basic4ppc.com/forum/andr...eelance-library-development-6.html#post134332


Special thanks and credits goes to NJDude for the sample.

Kind regards,
Tomas
 

Rick Harris

Well-Known Member
Licensed 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
Thank you very much. I contacted Tomas a week ago, but so far no reply. I assumed that you had your own solution when you described how simple it is in Post #9. Can't you help me any further? Is Tomas' library still working? On other fora I keep reading that Google has recently changed the format and their API is giving a lot of problems.
 

Rick Harris

Well-Known Member
Licensed User
please tell us what languages are supported ?
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
 
Last edited:

XverhelstX

Well-Known Member
Licensed 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
 

Rick Harris

Well-Known Member
Licensed User
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
Hello Tomas,
Thank you for following my recommendation to provide the above amended 'Startlistening' routine to the forum.
It will save others many hours, like I had to, to figure out how to add a language selector and a VU meter.
Just a tip for other users of your excellent library regarding setting the language:
- Add a variable in Main to the Globals: Dim SRlang as string
- Before calling Startlistening set this variable to for example SRLang = "en-US"
- In the Startlistening routine replace:
B4X:
 i.PutExtra("android.speech.extra.LANGUAGE", "en-US")
into:
B4X:
 i.PutExtra("android.speech.extra.LANGUAGE", Main.SRLang)
 
Last edited:
Top