Baidu Speech Recognition (Voice) Android Studio version of the detailed _android

Source: Internet
Author: User

Baidu Speech Recognition (Voice) Android Studio version

Synchronized update to personal blog:http://dxjia.cn/2016/02/29/baidu-voice-helper/

Recently in a practicing small project to use speech recognition, search for a bit, more easily integrated even if the Baidu voice with the voice of the fly, Baidu provides a direct use of the display control, and the need to realize the fly, in addition to Baidu to provide 5W times a day call frequency, Enough for me to use. So choose to use Baidu Voice (control will have Baidu logo and keywords, so the formal use of products to be considered).

Looking at the Android SDK provided by Baidu, or the Eclipse era, if you want to use his controls, you need to integrate his resource files into your engineering directory, and you'll need to add permissions and activity to the Androidmanifest.xml, Service statements, and so on, some cumbersome, and these files are mixed in your project, a little messy.

In addition, there is a point, the control provided by Baidu must set up their own beep files, not set, the SDK will report null point error.

Intent.putextra (Extra_sound_start, r.raw.bdspeech_recognition_start);
Intent.putextra (Extra_sound_end, r.raw.bdspeech_speech_end);
Intent.putextra (extra_sound_success, r.raw.bdspeech_recognition_success);
Intent.putextra (Extra_sound_error, r.raw.bdspeech_recognition_error);
Intent.putextra (Extra_sound_cancel, R.raw.bdspeech_recognition_cancel);

This is also because the current SDK jar does not contain the res file itself, so based on this, I ported his SDK to Android studio and packaged the resource files and jar so files into an AAR file. And also provides an interface file (only a few interfaces, to invoke the control), the development of the API method can also use this AAR package, because it contains the internal Baidu jar package, so Baidu's API can be referred to.

Library sharing on the GitHub, you can refer to the use of the README.

Https://github.com/dxjia/BaiduVoiceHelper

The above is to Baidu speech recognition of data collation, follow-up continue to supplement the relevant information, thank you for your support of this site!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.