รหัสสินค้า | AG30170 |
หมวดหมู่ | Audio/Sound/MP3/Voice |
ราคา | 950.00 บาท |
สถานะสินค้า | พร้อมส่ง |
จำนวน | ชิ้น |
Pros |
Cons |
|
Offline Speech Recognition |
1. Quickly respond to corresponding command words and instructions. 2. No need for a network. 3. If speech recognition fails, it will not affect the use of other product functions. 4. More secure privacy, users don't have to worry about their conversation content being recorded and uploaded to the cloud. 5. Small module size, convenient for embedding in applications. 6. Cheaper price. |
Command words are fixed, and there may be limitations on the number and length of words. |
Online Speech Recognition |
1. Consumers are easy to use and not limited to command words. 2. Easy to develop, and there are many solutions in the market. |
1. Requires network connection to connect to the cloud. 2. Response speed depends on the network speed. 3. Higher cost. |
SHIPPING LIST
Please switch the communication mode switch to the I2C and download the required library file DFRobot_DF2301Q library for the code.
/*!
* @file i2c.ino
* @brief Control the voice recognition module via I2C
* @n Get the recognized command ID and play the corresponding reply audio according to the ID;
* @n Get and set the wake-up state duration
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @licence The MIT License (MIT)
* @author [qsjhyy](yihuan.huang@dfrobot.com)
* @version V1.0
* @date 2022-04-02
* @url https://github.com/DFRobot/DFRobot_DF2301Q
*/
#include "DFRobot_DF2301Q.h"
#define Led 8
//I2C communication
DFRobot_DF2301Q_I2C asr;
void setup() {
Serial.begin(115200);
pinMode(Led, OUTPUT); //Init LED pin to output mode
digitalWrite(Led, LOW); //Set LED pin to low
// Init the sensor
while (!(asr.begin())) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Begin ok!");
/**
* @brief Set voice volume
* @param voc - Volume value(1~7)
*/
asr.setVolume(4);
/**
@brief Set mute mode
@param mode - Mute mode; set value 1: mute, 0: unmute
*/
asr.setMuteMode(0);
/**
@brief Set wake-up duration
@param wakeTime - Wake-up duration (0-255)
*/
asr.setWakeTime(20);
/**
@brief Get wake-up duration
@return The currently-set wake-up period
*/
uint8_t wakeTime = 0;
wakeTime = asr.getWakeTime();
Serial.print("wakeTime = ");
Serial.println(wakeTime);
// asr.playByCMDID(1); // Wake-up command
/**
@brief Play the corresponding reply audio according to the ID
@param CMDID - command word ID
*/
//asr.playByCMDID(23); // Command word ID
}
void loop() {
/**
@brief Get the ID corresponding to the command word
@return Return the obtained command word ID, returning 0 means no valid ID is obtained
*/
uint8_t CMDID = asr.getCMDID();
switch (CMDID) {
case 103: //If the command is “Turn on the light”
digitalWrite(Led, HIGH); //Turn on the LED
Serial.println("received'Turn on the light',command flag'103'"); //Serial transmits "received"Turn on the light",command flag"103
break;
case 104: //If the command is “Turn off the light”
digitalWrite(Led, LOW); //Turn off the LED
Serial.println("received'Turn off the light',command flag'104'"); //The serial transmits "received"Turn off the light",command flag"104""
break;
default:
if (CMDID != 0) {
Serial.print("CMDID = "); //Printing command ID
Serial.println(CMDID);
}
}
delay(300);
}
Use a fixed or learned wake-up word to activate the speech recognition module, then speak out "Turn on the light" or "Turn off the light" to control the illumination module.
Please switch the communication mode switch to the UART and download the required library file DFRobot_DF2301Q library for the code.
/*!
* @file uart.ino
* @brief Control the voice recognition module via UART
* @n Get the recognized command ID and play the corresponding reply audio according to the ID;
* @n Set the wake-up state duration, set mute mode, set volume, enter the wake-up state, and reset the module
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @licence The MIT License (MIT)
* @author [qsjhyy](yihuan.huang@dfrobot.com)
* @version V1.0
* @date 2022-04-02
* @url https://github.com/DFRobot/DFRobot_DF2301Q
*/
#include "DFRobot_DF2301Q.h"
#define Led 8
/**
@brief DFRobot_URM13_RTU constructor
@param serial - serial ports for communication, supporting hard and soft serial ports
@param rx - UART The pin for receiving data
@param tx - UART The pin for transmitting data
*/
#if (defined(ARDUINO_AVR_UNO) || defined(ESP8266)) // Use software serial
SoftwareSerial softSerial(/*rx =*/4, /*tx =*/5);
DFRobot_DF2301Q_UART asr(/*softSerial =*/&softSerial);
#elif defined(ESP32) // Use the hardware serial with remappable pin: Serial1
DFRobot_DF2301Q_UART asr(/*hardSerial =*/&Serial1, /*rx =*/D3, /*tx =*/D2);
#else // Use hardware serial: Serial1
DFRobot_DF2301Q_UART asr(/*hardSerial =*/&Serial1);
#endif
void setup() {
Serial.begin(115200);
pinMode(Led, OUTPUT); //Init LED pin to output mode
digitalWrite(Led, LOW); //Set LED pin to low
// Init the sensor
while (!(asr.begin())) {
Serial.println("Communication with device failed, please check connection");
delay(3000);
}
Serial.println("Begin ok!");
/**
@brief Reset module
*/
// asr.resetModule();
/**
@brief Set commands of the module
@param setType - Set type
@n DF2301Q_UART_MSG_CMD_SET_VOLUME: Set volume, the set value range 1-7
@n DF2301Q_UART_MSG_CMD_SET_ENTERWAKEUP: Enter wake-up state; set value 0
@n DF2301Q_UART_MSG_CMD_SET_MUTE Mute mode; set value 1: mute, 0: unmute
@n DF2301Q_UART_MSG_CMD_SET_WAKE_TIME ; Wake-up duration; the set value range 0-255s
@param setValue - Set value, refer to the set type above for the range
*/
asr.settingCMD(DF2301Q_UART_MSG_CMD_SET_MUTE, 0);
asr.settingCMD(DF2301Q_UART_MSG_CMD_SET_VOLUME, 7);
asr.settingCMD(DF2301Q_UART_MSG_CMD_SET_WAKE_TIME, 20);
//asr.settingCMD(DF2301Q_UART_MSG_CMD_SET_ENTERWAKEUP, 0);
/**
@brief Play the corresponding reply audio according to the command word ID
@param CMDID - Command word ID
*/
asr.playByCMDID(23);
}
void loop() {
/**
@brief Get the ID corresponding to the command word
@return Return the obtained command word ID, returning 0 means no valid ID is obtained
*/
uint8_t CMDID = asr.getCMDID();
switch (CMDID) {
case 103: //If the command is “Turn on the light”
digitalWrite(Led, HIGH); //Turn on the LED
Serial.println("received'Turn on the light',command flag'103'"); //Serial transmits "received"Turn on the light",command flag"103""
break;
case 104: //If the command is “Turn off the light”
digitalWrite(Led, LOW); //Turn off the LED
Serial.println("received'Turn off the light',command flag'104'"); //The serial transmits "received"Turn off the light",command flag"104""
break;
default:
if (CMDID != 0) {
Serial.print("CMDID = "); //Print command ID
Serial.println(CMDID);
}
}
delay(300);
}
Use a fixed or learned wake-up word to activate the speech recognition module, then speak out "Turn on the light" or "Turn off the light" to control the illumination module.
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีธนาคาร KBANK, SCB, BBL,TMB
กรุณาเก็บหลักฐานการโอนเงินของท่านไว้เพื่อแจ้งการชำระเงินด้วยค่ะ
ท่านสามารถแจ้งการชำระเงินผ่านระบบอัตโนมัติได้โดย Click Link ข้างล่างค่ะ
https://www.arduitronics.com/informpayment
หน้าที่เข้าชม | 15,389,628 ครั้ง |
ผู้ชมทั้งหมด | 5,892,706 ครั้ง |
เปิดร้าน | 21 พ.ค. 2556 |
ร้านค้าอัพเดท | 15 ก.ย. 2568 |