Program to record speech audio into RAM and then play it back, moving Billy Bass's mouth in sync with the speech.

Dependencies:   mbed

Remember Big Mouth Billy Bass?

I've made a simple demo program for him using the Freescale FRDM-KL25Z board. I've hooked up the digital I/O to his motor driver transistors and pushbutton switch.

This program records 1.8 seconds of speech audio from ADC input when the pushbutton is pressed, then plays the audio back with Billy Bass's mouth controlled so that it opens during vowel sounds.

The ADC input is driven from a microphone and preamplifier, via a capacitor and into a resistor divider connected to the +3.3V supply pin to provide mid-range biasing for the ADC signals.

The DAC output is connected to his audio amplifier input (to the trace that was connected to pin 10 of the controller IC). I had to provide a DC bias using the DAC to get the single transistor amplifier biased into proper operation.

For more on the method of vowel recognition, please see the paper: http://www.mirlab.org/conference_papers/International_Conference/ICASSP%201999/PDF/AUTHOR/IC991957.PDF

Y. Nishida, Y. Nakadai, Y. Suzuki, T. Sakurai, T. Kurokawa, and H. Sato. 1999.

Voice recognition focusing on vowel strings on a fixed-point 20-MIPS DSP board.

In Proceedings of the Acoustics, Speech, and Signal Processing, 1999. on 1999 IEEE International Conference - Volume 01 (ICASSP '99), Vol. 1. IEEE Computer Society, Washington, DC, USA, 137-140. DOI=10.1109/ICASSP.1999.758081 http://dx.doi.org/10.1109/ICASSP.1999.758081

Committer:
bikeNomad
Date:
Fri May 10 02:15:44 2013 +0000
Revision:
0:1ddd40d843cb
Child:
1:2fa375aacece
simple billy bass motor exerciser;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bikeNomad 0:1ddd40d843cb 1 #include "mbed.h"
bikeNomad 0:1ddd40d843cb 2
bikeNomad 0:1ddd40d843cb 3 Serial pc(USBTX, USBRX);
bikeNomad 0:1ddd40d843cb 4 DigitalOut tail(PTA13);
bikeNomad 0:1ddd40d843cb 5 DigitalOut mouth(PTC12);
bikeNomad 0:1ddd40d843cb 6 DigitalOut head(PTC13);
bikeNomad 0:1ddd40d843cb 7
bikeNomad 0:1ddd40d843cb 8 void exercise_mouth(void)
bikeNomad 0:1ddd40d843cb 9 {
bikeNomad 0:1ddd40d843cb 10 for (int i = 0; i < 200; i++) {
bikeNomad 0:1ddd40d843cb 11 mouth = true;
bikeNomad 0:1ddd40d843cb 12 wait(0.5);
bikeNomad 0:1ddd40d843cb 13 mouth = false;
bikeNomad 0:1ddd40d843cb 14 wait(0.5);
bikeNomad 0:1ddd40d843cb 15 }
bikeNomad 0:1ddd40d843cb 16 }
bikeNomad 0:1ddd40d843cb 17
bikeNomad 0:1ddd40d843cb 18 int main()
bikeNomad 0:1ddd40d843cb 19 {
bikeNomad 0:1ddd40d843cb 20 pc.baud(9600);
bikeNomad 0:1ddd40d843cb 21 pc.puts("A=1 tail on, a=1 off, same for b (mouth) and c (head); x=exercise_mouth");
bikeNomad 0:1ddd40d843cb 22 while(true) {
bikeNomad 0:1ddd40d843cb 23 if (pc.readable()) {
bikeNomad 0:1ddd40d843cb 24 int c = pc.getc();
bikeNomad 0:1ddd40d843cb 25 pc.putc(c);
bikeNomad 0:1ddd40d843cb 26 switch (c) {
bikeNomad 0:1ddd40d843cb 27 case 'A':
bikeNomad 0:1ddd40d843cb 28 tail = true;
bikeNomad 0:1ddd40d843cb 29 break;
bikeNomad 0:1ddd40d843cb 30 case 'a':
bikeNomad 0:1ddd40d843cb 31 tail = false;
bikeNomad 0:1ddd40d843cb 32 break;
bikeNomad 0:1ddd40d843cb 33 case 'B':
bikeNomad 0:1ddd40d843cb 34 mouth = true;
bikeNomad 0:1ddd40d843cb 35 break;
bikeNomad 0:1ddd40d843cb 36 case 'b':
bikeNomad 0:1ddd40d843cb 37 mouth = false;
bikeNomad 0:1ddd40d843cb 38 break;
bikeNomad 0:1ddd40d843cb 39 case 'C':
bikeNomad 0:1ddd40d843cb 40 head = true;
bikeNomad 0:1ddd40d843cb 41 break;
bikeNomad 0:1ddd40d843cb 42 case 'c':
bikeNomad 0:1ddd40d843cb 43 head = false;
bikeNomad 0:1ddd40d843cb 44 break;
bikeNomad 0:1ddd40d843cb 45 case 'x':
bikeNomad 0:1ddd40d843cb 46 exercise_mouth();
bikeNomad 0:1ddd40d843cb 47 break;
bikeNomad 0:1ddd40d843cb 48 default:
bikeNomad 0:1ddd40d843cb 49 break;
bikeNomad 0:1ddd40d843cb 50 }
bikeNomad 0:1ddd40d843cb 51 }
bikeNomad 0:1ddd40d843cb 52 }
bikeNomad 0:1ddd40d843cb 53 }