Wanson asr demo
1 Functional Overview
Based on the local speech recognition library provided by the third-party company
Huazhen, the local offline voice wake-up word and command word recognition functions are realized.
2 Code Path
demo path:
\components\audio_algorithm\wanson_asrWanson local speech recognition library (floating point library) path:
\components\bk_thirdparty\asr\wansonFor detailed description of Wanson’s local speech recognition API interface, please refer to the source file:
\components\bk_thirdparty\asr\wanson\include\asr.hDEMO Compilation instruction:
make bk7258 PROJECT=thirdparty/wanson_asr
3. Demonstration introduction
After burning the firmware, the device will run real-time voice recognition function when powered on, and can be verified by saying wake-up words and command words to the mic.
The supported wake-up words and command words are as follows:
Little Bee Stewardrecognizes successfully and prints the logxiao feng guan jiaon the serial port
arminorecognizes successfully and prints the loga er mi nuoon the serial port
Visitor moderecognize successful serial port print loghui ke mo shi
dining moderecognizes successfully and prints the logyong can mo shion the serial port
Leave moderecognize successful serial port print logli kai mo shi
home modeidentification success serial port print loghui jia mo shi
4. wanson asr development guide
Note
The wanson Speech Recognition Library requires the audio stream format to be: mono, 16K sampling rate, and 16bit bit width.
wanson Speech Recognition Library is based on floating-point arithmetic.
After modifying the wake word or command word, the
libasr.alibrary needs to be replaced.
The process of developing real-time offline recognition based on the wanson speech recognition library is as follows:
Initialize speech recognition
Initialize audio sampling
Run speech recognition
Turn on audio sampling
Examples of interface calls are as follows:
/* init wanson asr lib */
Wanson_ASR_Init()
//reset wanson asr
Wanson_ASR_Reset();
/* init mic record */
aud_intf_drv_setup.aud_intf_tx_mic_data = aud_asr_handle;
//init audio component
bk_aud_intf_drv_init(&aud_intf_drv_setup);
aud_work_mode = AUD_INTF_WORK_MODE_GENERAL;
//set audio component work mode
bk_aud_intf_set_mode(aud_work_mode);
//init audio mic
aud_intf_mic_setup.samp_rate = AUD_ADC_SAMP_RATE_16K;
ret = bk_aud_intf_mic_init(&aud_intf_mic_setup);
/* start Speech Recognition */
//Continuously send the collected data to the algorithm for recognition
Wanson_ASR_Recog((short*)asr_buff, 480, &text, &score);
/* turn on audio sampling */
bk_aud_intf_mic_start();
5. Shanghai Huazhen Electronic Technology Co., Ltd.
Official website: http://www.wanson.cn/Headquarters Address: Room 307-308, Huigaoguang Innovation Park, No. 789 Shenwang Road, Minhang District, Shanghai | Shenzhen Office Address: Room 2215-16, East Block, Building 1A, Huiyi City One Center, Xixiang, Baoan District, ShenzhenTel: 021-61557858Mobile: 1352485917613296017858