Voice Recognition Shield acts as Arduino Shield via 1Sheeld

Buy 1Sheeld
Speech recognition with Arduino and 1Sheeld
Control your Arduino with voice commands with 1 line of code, you can trigger it to control a robot or talk to your home appliances!
Learn more from the examples page.
 

This shield is one of the special shields. Special shields allows your Arduino board 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.

Voice recognition  library takes commands by your voice and send 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 Voice Recognizer shield only amongst all shields and prevent 1Sheeld library from eating your memory specially for UNO board.

“There are permissions to be granted by Android M users before they can use the Voice Recognition shield please make sure to grant the permissions or else it may affect the application’s performance.”

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();

Get last command you spoked out.

SYNTAX

VoiceRecognition.getLastCommand( );

RETURNS

A char array type data.

PARAMETERS

None.

USAGE

char* myArray = VoiceRecognition.getLastCommand();

Get last command you spoked out.

SYNTAX

VoiceRecognition.getLastCommandAsString( );

RETURNS

String type data.

PARAMETERS

None.

USAGE

String command = VoiceRecognition.getLastCommandAsString();

Get last command length you spoked out.

SYNTAX

VoiceRecognition.getLastCommandLength( );

RETURNS

Numbers of bytes in the last commands.

PARAMETERS

None.

USAGE

int commandLength = VoiceRecognition.getLastCommandLength();

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

SYNTAX

VoiceRecognition.isNewCommandReceived( );

RETURNS

A yes “1” or no “0”.

PARAMETERS

None.

USAGE

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

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);
}

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);
}

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.

Types of Errors:

NETWORK_TIMEOUT_ERROR == 1

NETWORK_ERROR == 2

AUDIO_ERROR == 3

SERVER_ERROR == 4

SPEECH_TIMEOUT_ERROR == 6

NO_MATCH_ERROR == 7

RECOGNIZER_BUSY_ERROR == 8

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;
      }
}