English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Detailed Explanation of Baidu Voice Recognition (Baidu Voice) Android Studio Version

Baidu Voice Recognition (Baidu Voice) Android Studio version

      has been synchronized updated to my personal blog: http://dxjia.cn/2016/02/29/baidu-voice-helper/

      Recently, I need to use voice recognition in a small practice project. After searching, the ones that are relatively easy to integrate are Baidu Voice and Xunfei Voice. Baidu provides a display control panel that can be used directly, while Xunfei needs to be implemented by yourself. In addition, Baidu provides5The call frequency of W times is enough for me to use. So I choose to use Baidu Voice (the control panel will have a Baidu logo and keywords, so it needs to be considered for formal product use).

    I took a look at the Baidu-provided Android SDK, which is still from the Eclipse era. If you want to use its control panel, you need to integrate its resource files into your project directory, and also add permissions and activity, service declarations in AndroidManifest.xml, which is somewhat cumbersome, and these folders are scattered in your project, which is somewhat disorganized.

     Additionally, there is a point to note that the control panel provided by Baidu must be set up with a prompt sound file by yourself. If not set, the SDK will report a 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 because the current sdk jar cannot contain res files by itself, so based on this, I have ported his sdk to android studio, and packed these resource files and jar packages so files into an aar file, and provided an interface file (only a few interfaces, used to call controls). API development can also use this aar package, because it internally contains baidu's jar package, so all baidu's api can be referenced.

     The library sharing is on github, you can refer to readme for use.

           https://github.com/dxjia/BaiduVoiceHelper

This is the compilation of the materials of Baidu Voice Recognition. We will continue to supplement relevant materials in the future, thank you all for your support to this site! 

Declaration: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#w3Please report via email to codebox.com (replace # with @) when reporting, and provide relevant evidence. Once verified, this site will immediately delete the suspected infringing content.

You May Also Like