Programming for Alpha Magic Summary

We want the user to be able to repeat the word and also carry out the movement related to this word so we plan to use voice recognition and an accelerometer (Wii remote) to do this.

We looked at programming this in flash but we found that there were a lot of problems associated with programming voice recognition in this way For example the program would only recognise the voice of the person who created it.

We then  looked at programming it in JavaScript  with HTML5 or Processing. We found that both worked in terms of the voice recognition and we got samples working in both. However we have a clearer understanding of how the Processing sample works compared to the JavaScript one.

The Processing example uses Voce which is  a speech synthesis and recognition library that is cross platform and has a very small API  (Application Programming Interface). It uses CMU Sphinx4 and Free TTS. It uses a grammer file in a JSGF format.

CMU Sphinx4 is a open source library written in Java.

FreeTTS is a free open source Speech Syntheses library also written in Java.

Both work on multiple platforms.

JSGF – Java Speech Grammer Format – a textul representation of grammers for use in speech recognition.

We have looked at using an accelerometer with processing  and it is possible but we are not completely sure how yet. This is the next thing we have to look at. 

Processing

In one of the meeting with the lecturers it was suggested that we go back and look at processing for our project so I have. I have found some examples online for the voice recognition and a lot of sites have suggested Voce for this. The only problem at the minute is I am having trouble installing Voce into the library to see the examples working. I think between Processing and JavaScript and HTML5 I would feel more confident doing it in processing. I have also looked up accelerometers with processing and this also seems to be possible although we may need an arduino to do this. 

Some Code help for the Game

How to create a button in processing:

int inside = -1; // flag for know if show or not show the other rectangle; -1 = no show ; 1 = show
int bx=400; // position in X of the up corner of the botton
int by=300; // position in Y of the up corner of the botton

void setup()
{
size(800,600);
}

void draw()
{
background(0);
rect(400,300,60,60); // Our Button in the position (400,300) with size of 60 pixels by 60 pixels
if(inside==1)rect(10,10,100,100); // acction that have to happend when we press the button
}
void mousePressed(){
if(!(((mouseX > ( bx+60))||(mouseY > (by+60)))||((mouseX < bx)||(mouseY < by))))inside=inside*-1; // condition to know if we do clik inside the button
}

How to play a movie in processing:

http://processing.org/reference/libraries/video/index.html

import processing.video.*;
Movie myMovie;

void setup() {
  size(200, 200);
  myMovie = new Movie(this, "totoro.mov");
  myMovie.play();
}

void draw() {
  image(myMovie, 0, 0);
}

void movieEvent(Movie m) {
  m.read();
}
Connecting a controller to processing Example:
 
 
Using an Accelorometer with processing:
 
 
 
 
Voice Recognition:
 
 
 
 
 
 

Logo for the game

 

This is the proposed logo design for the game. I used the A as the wizards hat and the M as the shape of his face. I wanted to keep it in a cartoony style that children could relate to.

 

Some links for voice recognition

http://stackoverflow.com/questions/9982615/speech-recognition-in-flash

http://www.bigwebmaster.com/General/Howtos/Speech-Recognition-HOWTO/

http://blog.immanuelnoel.com/2011/12/07/new-actionscript-native-extension-speech-recognition/

http://flashvisions.com/actionscript-3/voice-recognition-with-actionscript-3-0-and-air/

http://www.lunawebs.com/flash-dynamic-speech.php

http://www.speechapi.com/

http://www.daimi.au.dk/~thomasr/interaction/SpeechXML.html