Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Installation

arjo129 edited this page Dec 17, 2012 · 11 revisions

Get a copy of µSpeech of the home page (http://arjo129.github.com/uSpeech/). It is available as both a zip file and a Tarball. Installation occurs like any other library. You can read more about installation of libraries here: http://arduino.cc/en/Guide/Libraries

Calibration

Just like any other library µSpeech is meant to be installed in your arduino libraries folder under a directory named uSpeech. Now comes the tricky part. Wire up a condenser mic with a pre-amp (see the [Hardware] section) and hook a microphone onto analog pin A0 and create a new sketch in the arduino IDE. Copy and paste the following in:

#include <uspeech.h>
signal voice(A0);
void setup(){
    voice.calibrate();
    Serial.begin(9600);
  }
void loop(){
      voice.sample();
      Serial.println(voice.power());
  
}

Upload the code to your arduino/AVR board then open the serial monitor. You will see a stream of numbers, this is the loudness of your system. Now keep quiet. Then after 1 second stop autoscrolling. Select the most common value and copy it. In my case it was 92. Open your arduino library directory find the source code of µSpeech. Open uspeech.h in a text editor. At the top you will see the following:

#include "Arduino.h"
#include <math.h>
#define SILENCE 92

Change the value of SILENCE to your value. Now you are set to get your first voice recognition project going.

Clone this wiki locally