Hi sir.If I record more than 7 voice commends,How do write code?
How anyone writes code, by pressing keys on your keyboard
You write code in the arduino IDE or an alternative software environment using C++. Your statement gives no additional information from which to form a more helpful answer. In fact it is so poorly formed that it more closely resembles spam than a question and may be treated as such unless you elucidate
Your post is lacking every detail that might be needed for a useful response. So I googled for you
Anything in here? voice 7 site:forum.arduino.cc - Google Search
@thetpaingphyoe
You may want to read this before you proceed:-
how to get the best out of this forum
It tells you what we need to supply in order to help you.
You don't bother to say but my guess is that you want to use an Elechouse "Voice Recognition Module V3".
It will recognize up to 80 voice commands, but only 7 at any one time. You have to pick which 7 words to recognize first and then, based on which word was said, pick different sets of 7 words to recognize.
And note that you can't use one of those voice messages to switch the set you want because you would need to say something like "Bank3 'command in bank 3' " which would be a bit of a pain.
Sir.Can you have example code for more than 7 voices commond(multiple command) .I lf you have,please give me .
Sure. Here is an example from the VoiceRecognitionV3 library:
/**
******************************************************************************
* @file vr_sample_multi_cmd.ino
* @author JiapengLi
* @brief This file provides a demostration on
how to implement a multi voice command project (exceed 7 voice command)
by using VoiceRecognitionModule
******************************************************************************
* @note:
voice control led
******************************************************************************
* @section HISTORY
2013/06/13 Initial version.
*/
#include <SoftwareSerial.h>
#include "VoiceRecognitionV3.h"
/**
Connection
Arduino VoiceRecognitionModule
2 -------> TX
3 -------> RX
*/
VR myVR(2,3); // 2:RX 3:TX, you can choose your favourite pins.
uint8_t record[7]; // save record
uint8_t buf[64];
int led = 13;
int group = 0;
#define switchRecord (0)
#define group0Record1 (1)
#define group0Record2 (2)
#define group0Record3 (3)
#define group0Record4 (4)
#define group0Record5 (5)
#define group0Record6 (6)
#define group1Record1 (7)
#define group1Record2 (8)
#define group1Record3 (9)
#define group1Record4 (10)
#define group1Record5 (11)
#define group1Record6 (12)
void setup()
{
/** initialize */
myVR.begin(9600);
Serial.begin(115200);
Serial.println("Elechouse Voice Recognition V3 Module\r\nMulti Commands sample");
pinMode(led, OUTPUT);
if(myVR.clear() == 0){
Serial.println("Recognizer cleared.");
}else{
Serial.println("Not find VoiceRecognitionModule.");
Serial.println("Please check connection and restart Arduino.");
while(1);
}
record[0] = switchRecord;
record[1] = group0Record1;
record[2] = group0Record2;
record[3] = group0Record3;
record[4] = group0Record4;
record[5] = group0Record5;
record[6] = group0Record6;
group = 0;
if(myVR.load(record, 7) >= 0){
printRecord(record, 7);
Serial.println(F("loaded."));
}
}
void loop()
{
int ret;
ret = myVR.recognize(buf, 50);
if(ret>0){
switch(buf[1]){
case switchRecord:
/** turn on LED */
if(digitalRead(led) == HIGH){
digitalWrite(led, LOW);
}else{
digitalWrite(led, HIGH);
}
if(group == 0){
group = 1;
myVR.clear();
record[0] = switchRecord;
record[1] = group1Record1;
record[2] = group1Record2;
record[3] = group1Record3;
record[4] = group1Record4;
record[5] = group1Record5;
record[6] = group1Record6;
if(myVR.load(record, 7) >= 0){
printRecord(record, 7);
Serial.println(F("loaded."));
}
}else{
group = 0;
myVR.clear();
record[0] = switchRecord;
record[1] = group0Record1;
record[2] = group0Record2;
record[3] = group0Record3;
record[4] = group0Record4;
record[5] = group0Record5;
record[6] = group0Record6;
if(myVR.load(record, 7) >= 0){
printRecord(record, 7);
Serial.println(F("loaded."));
}
}
break;
default:
break;
}
/** voice recognized */
printVR(buf);
}
}
/**
@brief Print signature, if the character is invisible,
print hexible value instead.
@param buf --> command length
len --> number of parameters
*/
void printSignature(uint8_t *buf, int len)
{
int i;
for(i=0; i<len; i++){
if(buf[i]>0x19 && buf[i]<0x7F){
Serial.write(buf[i]);
}
else{
Serial.print("[");
Serial.print(buf[i], HEX);
Serial.print("]");
}
}
}
/**
@brief Print signature, if the character is invisible,
print hexible value instead.
@param buf --> VR module return value when voice is recognized.
buf[0] --> Group mode(FF: None Group, 0x8n: User, 0x0n:System
buf[1] --> number of record which is recognized.
buf[2] --> Recognizer index(position) value of the recognized record.
buf[3] --> Signature length
buf[4]~buf[n] --> Signature
*/
void printVR(uint8_t *buf)
{
Serial.println("VR Index\tGroup\tRecordNum\tSignature");
Serial.print(buf[2], DEC);
Serial.print("\t\t");
if(buf[0] == 0xFF){
Serial.print("NONE");
}
else if(buf[0]&0x80){
Serial.print("UG ");
Serial.print(buf[0]&(~0x80), DEC);
}
else{
Serial.print("SG ");
Serial.print(buf[0], DEC);
}
Serial.print("\t");
Serial.print(buf[1], DEC);
Serial.print("\t\t");
if(buf[3]>0){
printSignature(buf+4, buf[3]);
}
else{
Serial.print("NONE");
}
// Serial.println("\r\n");
Serial.println();
}
void printRecord(uint8_t *buf, uint8_t len)
{
Serial.print(F("Record: "));
for(int i=0; i<len; i++){
Serial.print(buf[i], DEC);
Serial.print(", ");
}
}
Sir.This is one voice command.Can you have perfect 12 voice commands like above code.
If you have,please give me
No, this is 13 voice commands. They are labeled 0 through 12.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.