简体   繁体   中英

Google speech to text api android

Android google speech to text SDK, the voice recording is controlled by SDK . I need to make it manual button for start and stop voice recording for speech to text. for eg: while click a button for start the voice recognition , its continue to record the audio until click the stop button. but in android SDK , its automatically stop the recording and pass the recorded audio for processing.

I created an updated version of the Android sample application with Start and Stop, and posted it here:

https://github.com/Avilaaiops/SpeechRecognitionClient

It updates Gradle to 4.0.1, Kotlin to 1.3.72, and the Speech SDK to 1.24.0

This should help people looking for an up to date sample that isn't on the alpha SDK anymore.

As far as i know this is how its attended to work. There is no continuous speech recognition. To implement something like you requested, you need to use third party libraries like this or this one.

There is no official documentation on how to transcribe Audio from Streaming Input in Android yet but Java, C#, Go, Python and Node.JS. However there is a sample Android app for the API. You can use it as a starting point and convert the Java code into Android Native code.

Note: Even though Android uses Java but it is a different version which is designed to fit the Android architecture.

Using the approach I mentioned above requires extra effort, research skill as well as your Java and Android Fundamental Programming Skill. #thisisthehardway

The easier way will be applying external libraries like Droid Speech (As mentioned by @kAliert).

From the documentation of Droid Speech:

Droid Speech aims to close this gap and provide unparalleled optimisation of continuous speech recognition without any of the above said issues. It is developed keeping in mind all the loopholes which needs to be blocked to have the speech recognition run seamlessly in an android device.

This would be relative easy but it is made by third party as you have no full control on it.

Cheers!

For this i searched a lot, i didnt find any solution to implement Microsoft speech to text api . Finally i got the solution it worked for me , and hope i will work for you or it can help somebody who is searching. I am just mentioning the git repository link, Pickup the MainActivity.java,gradle(aap and project level) , layout xml and put in your project. Execute and enjoy the solution.

Git repository link is : MircoSoftSpeechToText

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM