Arduino Voice Recognition Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Arduino Voice Recognition Shield

Arduino Voice Recognition Shield is giving you the ability to control your Arduino using voice commands with just 1 line of code.
So now you can make your voice controlled lights, voice controlled home automation or even a voice controlled robot.

Arduino Voice Recognition Shield

This shield is one of the special shields. which allow your Arduino to use some capabilities your smartphone can do.
Like playing music, taking a picture, getting notifications, accessing the clock data and using the touch screen for various functions.Learn more from the special shields tutorial.

Arduino Voice recognition Shield

Arduino Voice recognition Shield library takes commands by your voice and sends it to Arduino so that it can take actions.

Adding #define CUSTOM_SETTINGS along with #define INCLUDE_VOICE_RECOGNIZER_SHIELD is a key that will let you unlock the Arduino Voice Recognition shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

Note

– For Android M(6) or greater, there are permissions to be granted before using the Data Logger shield, please make sure to grant the permissions or else it may affect the application’s performance.

void start(void)

Sends a request to start listen to your command. (has the same functionality of pressing the button to say the command but now from arduino and doesn’t require to press the button in voice shield)

 

SYNTAX
VoiceRecognition.start();

 

RETURNS
None.

 

PARAMETERS
None.

 

USAGE
VoiceRecognition.start();

 

char * getLastCommand(void)

Get last command you spoked out.

 

SYNTAX
VoiceRecognition.getLastCommand();

 

RETURNS
Returns a char array holding the data.

 

PARAMETERS
None.

 

USAGE
char* myArray = VoiceRecognition.getLastCommand();

 

String getLastCommandAsString(void)

Get last command you spoked out.

 

SYNTAX
VoiceRecognition.getLastCommand();

 

RETURNS
Returns a string object holding the data.

 

PARAMETERS
None.

 

USAGE
String myArray = VoiceRecognition.getLastCommandAsString();

 

int getLastCommandLength(void)

Get last command length you spoked out.

 

SYNTAX
VoiceRecognition.getLastCommandLength();

 

RETURNS
Returns an integer holding last data length.

 

PARAMETERS
None.

 

USAGE
int commandLength = VoiceRecognition.getLastCommandLength();

 

bool isNewCommandReceived(void)

Checks if there’s a new command received by the application.

 

SYNTAX
VoiceRecognition.isNewCommandReceived();

 

RETURNS
Returns a yes “1” or no “0”.

 

PARAMETERS
None.

 

USAGE
if(VoiceRecognition.isNewCommandReceived())
{
  /* Print out the new command. */
  Terminal.println( VoiceRecognition.getLastCommand());
}

 

void setOnNewCommand(void(*userFunction)(char *))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new command is given.

 

SYNTAX
VoiceRecognition.setOnNewCommand(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
VoiceRecognition.setOnNewCommand(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new command is given. */
void myFunction (char *commandSpoken)
{
  /* Print out the command spoken. */
  Terminal.println(commandSpoken);
}

 

void setOnNewCommand(void(*userFunction)(String))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once a new command is given.

 

SYNTAX
VoiceRecognition.setOnNewCommand(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
VoiceRecognition.setOnNewCommand(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked each time a new command is given. */
void myFunction (String commandSpoken)
{
  /* Print out the command spoken. */
  Terminal.println(commandSpoken);
}

 

void setOnError(void(*userFunction)(byte))

Sets a certain individual function written by the user in the sketch to be called and runs its functionality once an error occurs due to unrecognized commands.

 

Error types:

NETWORK_TIMEOUT_ERROR
NETWORK_ERROR
AUDIO_ERROR
SERVER_ERROR
SPEECH_TIMEOUT_ERROR
NO_MATCH_ERROR
RECOGNIZER_BUSY_ERROR

 

SYNTAX
VoiceRecognition.setOnError(&userFunctionName);

 

RETURNS
None.

 

PARAMETERS
&userFunctionName: takes the physical address of the userFunction in the memory and jump to it once called to execute it’s functionality.

 

USAGE
VoiceRecognition.setOnError(&myFunction);
/* myFunction exists under the loop function. */
/* This function will be invoked once you select Twitter shield in the application. */
void myFunction (byte errorType)
{
  switch(errorType)
      {
           case NETWORK_TIMEOUT_ERROR: Terminal.println("Network timeout");break;
           case NETWORK_ERROR: Terminal.println("Network Error");break;
           case AUDIO_ERROR: Terminal.println("Audio error");break;
           case SERVER_ERROR: Terminal.println("No Server");break;
           case SPEECH_TIMEOUT_ERROR: Terminal.println("Speech timeout");break;
           case NO_MATCH_ERROR: Terminal.println("No match");break;
           case RECOGNIZER_BUSY_ERROR: Terminal.println("Busy");break;
      }
}