# Microphone Setup and Voice Command Setup

## Squinky86

EDIT: Side note: apparently this process is very selective for who it works for.  You may experience dificulty setting it all up, and cvoicecontrol may want to eat system resources after a while.

In continuation of the speechd lets your computer speak dtt, I've noticed that many others want to talk to their computers.  The short way:

follow the speechd DT&T (optional)

configure microphone

emerge cvoicecontrol

microphone_config

model_editor

write custom scripts executed on command

For those who need a little more verbosity:

Step 1:

After making sure you have festival working (speechd dtt), it's time to set up your microphone.  If you already have your microphone working in linux, skip down to step 2.  If you don't, I suggest gnome-alsamixer for configuring it correctly.

```
emerge gnome-alsamixer
```

Run gnome-alsamixer and make sure you have the following set correctly:

The "Mic" section is unmuted and the "Rec." button under the volume slider is selected.

The "Capture" section is turned up and "Rec." is selected.

Some users may find that the microphone works better when "Mic Boost (+20dB)" is checked.

Save the volumes and exit.

The microphone should now be working.  You can test it by talking into your microphone and you should hear your voice coming out of the speakers.  If you don't get your microhpone working here, you can go ahead and install cvoicecontrol, but will be unable to run its configuration tools.

Step 2:

Now to install cvoicecontrol.  This will be the voice recognition software that will call commands based on what you say.

```
emerge cvoicecontrol
```

Step 3:

Now to run the cvoicecontrol setup, which will configure cvoicecontrol to your computer.  WARNING: You MUST "killall artsd" or close any programs that are using your sound device, or these configuration programs will not work.

```
microphone_config
```

The program here is pretty self explanatory.  Just follow the on-screen directions.

Step 4:

Now that your microphone and cvoicecontrol are working together, it's time to set up the commands you want cvoicecontrol to run whenever you tell it to!

```
model_editor
```

By default, model_editor opens a new model, that is, the file in which cvoicecontrol saves and loads your settings from.  Select "Edit Speaker Model".  Press "a" to add a new item to this new model.  Hit enter to edit the item.  Make sure you give this new item an original title ("l" key), the command you want it to issue ("c"), and you're ready to record some samples of your voice for this command.  Record at least four samples of your voice ("r") for each command to make sure cvoicecontrol will pick up what you're saying correctly.  When you're done, hit "b" to go back and add as many commands as you want to this model.  When you are done, "Save Speaker Model" and exit.

Step 5:

It's time to run cvoicecontrol for the first time!  Make sure nothing is using your sound card, and run:

```
cvoicecontrol /path/to/savedmodel
```

Talk into your microphone and whatever you set in the model_editor should work.

Step 6:

Now we'll get into some fun stuff.  If you installed the optional festival text-to-speech program, you can make some custom scripts for your computer.  I suggest making a directory somewhere in your home directory to store these scripts.  Make sure they are executable (chmod +x)!  For compatibility's sake, I will use the pipe method of sending text to festival, though you can change this accordingly.

You say, "What time is it?"  The following script is called:

```
#!/bin/bash

# Speak a few lines

(echo "Today is"; date +%A; echo "and the current time is"; date +%I:%M\ %P) | festival --tts
```

Be creative and make your own scripts.  Maybe things like, "What is today's fortune?" running "fortune -s | festival --tts".

That's it!  If you have any other fun things to do with festival + cvoicecontrol, post them here.

Here are some words of warning for all males reading this:  If you have a female voice installed for festival, I suggest you remove cvoicecontrol now.  After a few weeks, you'll realize how terribly lonely you really are.  Take it from a geek who has been there.  Nothing beats the real thing- get a real woman! (I'm being facetious)

Edit:fixed fortune call (20030928)

fixed wording and format (20030929)

changed title to reflect contents better (20030929)

removed 2.6 kernel suggestion (20040221)

----------

## Anior

Great fun squinky and a nice guide it is too.

However, a little - managed to drop out of the last example.

"fortune | festival -tts" should be "fortune | festival --tts"

Just in case somebody got confused :)Last edited by Anior on Wed Sep 08, 2004 3:26 pm; edited 1 time in total

----------

## Squinky86

ah, thank you.  If you see any errors, be sure to bring them up so I can fix them in the main post  :Wink: .

----------

## kalisphoenix

 *Quote:*   

> 
> 
> Now to run the cvoicecontrol setup, which will configure cvoicecontrol to your computer. WARNING: You MUST "killall artsd" or close any programs that are using your sound device, or these configuration programs will not work. 
> 
> 

 

Not only do the programs work, but they create VERY interesting sound effects that you can use in a variety of interesting music programs.

 :Cool:  [/quote]

----------

## Qball

cvoicecontrol is using 100% cpu..  any ideas how to solve it? I forgot.

----------

## Roguelazer

Mmmm... This is fun. I already have my computer saying "You're welcome" every time someone says thank you. You forgot a tip. If you want some REAL fun, take your very long and complicated model and change the input device for sound from MIC to CD, then put in your favourite vocal CD.  :Very Happy: 

----------

## Squinky86

 *Qball wrote:*   

> cvoicecontrol is using 100% cpu.. any ideas how to solve it? I forgot.

 

Hmm, this happened to me a couple times when I was first setting up, but it hasn't happened to me as much recently.  All I could figure was that something wasn't configured properly.  Does this happen every time you start cvoicecontrol?  Let it run for a minute without your microphone plugged in- something might just be cluged up that needs sorted through.

 *Roguelazer wrote:*   

> change the input device for sound from MIC to CD, then put in your favourite vocal CD. 

 

Glad your having fun.  I'm debating putting a warning up, though:

WARNING: may cause loss of social life.  Your computer isn't a real person.

----------

## lukasfischer

are there any special hardware requirements for cvoicecontrol?

i could get it running on a very old ISA advances logic card, but not on the emu10k1 or the es1371! utterance levels and recordings are ok, but nothing is recognized, only the CPU load is at 100% all the time  :Sad: 

i'm using alsa and oss emulation.

----------

## Clete2

microphone_config doesn't work here... Can someone post me their config file and where to put it? It keeps on going. My microphone works fine... It just will never tell me to stop talking.

----------

## Squinky86

It looks like a lot of people are having trouble and running into little bugs here and there, so I put a little warning at the top of the main post.  I'd like to see more development on cvoicecontrol.

 *Clete2 wrote:*   

> Can someone post me their config file and where to put it?

 

~/.cvoicecontrol/config

```

Mixer Device    = /dev/mixer

Audio Device    = /dev/dsp

Mic Level       = 94

IGain Level     = 0

Record Level    = 5021

Stop Level      = 2711

Silence Level   = 401

Channel Mean    = 16.24192 9.33539 7.18034 5.85963 5.16997 4.52275 4.06734 3.89661 3.98458 3.96453 3.86085 3.95885 3.95009 3.97331 4.01739 3.78486

```

That "Channel Mean = # # #..." all goes on one line.

----------

## Clete2

Weird, I hear myself out of the speakers... (Thanks for the file by the way)... And it won't quite work, the config thing where you record a sample... Doesn't work... It will sit there when recording and I can press all the keys I want, but it won't quit recording... I said the command and no matter what, it won't record  :Sad: ...

Yeah, very selective on who it feels like working for...

----------

## Squinky86

In the model editor, make sure you speak loudly and with extreme orthographic care.  I noticed that small one-or-two sylable words will make model_editor not want to pick up the command.  This may or may not be your problem, but I do agree with you, the software needs to be developed more before put under any major use.  As of right now, this is really only a tool to use at lan parties to impress your friends.  I haven't seen an update from cvoicecontrol in months, and it's still in alpha.  Sorry it isn't working for you  :Sad: .

From the cvoicecontrol website: *Quote:*   

> Note: Since I am a full-time employee in the Speech and Language processing department at BBN Technologies it is virtually impossible for me to continue my development efforts on CVoiceControl. As a consequence, I do not intend to support CVoiceControl anymore. Anyone who is interested in taking over and advancing this project please feel free to contact me at daniel@kiecza.net.
> 
> 

 

I wish I knew more about programming.  Linux needs a project like this under development.

----------

## Clete2

Ok, thanks for the help. I set it to something simple. "open"... I will try again later...

----------

## colfax4

I've got a Sound Blaster Live! value using the emu10k1 driver.  My problem is similar to a post already made about this driver using alsa with oss emulation.  No matter what, nothing is recognized and my CPU shoots up to 100% every time.  Has anyone else had success with this driver/card... if not.  Would someone recommend a good card that cvoicecontrol works well for?

Thanks.

Colfax

----------

## BWoso

I am having some problems with this setup, I'm sure it's something easy but I don't know how to fix it.  Here is what I have done:  

```
emerge cvoicecontrol

-snip-

clear root # cvoicecontrol setup

Failed to read config file: /root/.cvoicecontrol/config

Please run 'microphone_config' first!

Couldn't load configuration!Please run microphone_config before using this application!

clear root # microphone_config

No mixer devices available!

Please purchase a sound card and install it!

```

I have an audigy 2 sound card which works, and a microphone that works with it.  Here is my lspci output. 

```
clear root # lspci

0000:00:00.0 Host bridge: Intel Corp.: Unknown device 2578 (rev 02)

0000:00:01.0 PCI bridge: Intel Corp.: Unknown device 2579 (rev 02)

0000:00:1d.0 USB Controller: Intel Corp.: Unknown device 24d2 (rev 02)

0000:00:1d.1 USB Controller: Intel Corp.: Unknown device 24d4 (rev 02)

0000:00:1d.2 USB Controller: Intel Corp.: Unknown device 24d7 (rev 02)

0000:00:1d.3 USB Controller: Intel Corp.: Unknown device 24de (rev 02)

0000:00:1d.7 USB Controller: Intel Corp.: Unknown device 24dd (rev 02)

0000:00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB PCI Bridge (rev c2)

0000:00:1f.0 ISA bridge: Intel Corp.: Unknown device 24d0 (rev 02)

0000:00:1f.1 IDE interface: Intel Corp.: Unknown device 24db (rev 02)

0000:00:1f.3 SMBus: Intel Corp.: Unknown device 24d3 (rev 02)

0000:01:00.0 VGA compatible controller: nVidia Corporation: Unknown device 0322 (rev a1)

0000:02:02.0 Multimedia audio controller: Creative Labs SB Audigy (rev 04)

0000:02:02.1 Input device controller: Creative Labs SB Audigy MIDI/Game port (rev 04)

0000:02:02.2 FireWire (IEEE 1394): Creative Labs SB Audigy FireWire Port (rev 04)

0000:02:08.0 Ethernet controller: Intel Corp.: Unknown device 1050 (rev 02)

0000:02:0a.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)

```

 Which obviously shows my sound card.  How do I make the setup see my soundcard?

----------

## Squinky86

Do you have a /dev/mixer device?

----------

## BWoso

No... how do I make that?

----------

## Squinky86

On my system, I have a 2.6 kernel, and I had to enable

Drivers --> Sound --> ALSA --> OSS Mixer API

----------

## megalomani

Make sure your mic is working. Just feedback from the speakers isn't enough.

I had to do chgroup audio /dev/audio

and add the user to the group audio.

Test the recording with for example krec

----------

## Vanquirius

Works nice with the one command I got it to understand so far: icq (opens gaim)... It doesn't like the way I say firefox, however.

[edit]Saying "fox" alone works  :Smile: [/edit]

----------

## undrwater

I'm planning on using this for Halloween!

I'll have my neice record the "Trick or Treat" instances...now I just have to figure what the response should be...."smell my feet" is a bit obvious!  :Wink: 

As for the sounblaster cards...in alsamixer, check to be sure which mic is selected.  In my case Mic2 was set as the default, which was incorrect...selecting Mic 1 fixed it.

----------

## Firewalker

Hmm, everything works fine but when i start cvoicecontrol it breaks... is anybody on this project atm? Maybe i should dig a bit into c programing....

----------

## undrwater

 *Firewalker wrote:*   

> Hmm, everything works fine but when i start cvoicecontrol it breaks... is anybody on this project atm? Maybe i should dig a bit into c programing....

 

What do you mean it breaks?  Maybe just a broken install or missing dependencies?

----------

## mirko_3

I'm trying to follow this howto, but it seems that I get the same errer as above:

```

No mixer devices available!

Please purchase a sound card and install it!

```

This even happens as root, so it's not a permission problem...

----------

## yodi

Getting the same error as mirko_3 here, although Teamspeak uses the OSS alsa modules with the mic fine which is odd.

----------

## bedahr

Same for me? No solution?

What a pitty...

mfg,

Bedahr

----------

## JloR

 *mirko_3 wrote:*   

> I'm trying to follow this howto, but it seems that I get the same errer as above:
> 
> ```
> 
> No mixer devices available!
> ...

 

Exact same problem here..

Soundcard: Audigy (1 not sure which kind of audigy1, but it is an audigy1..) :

```

Demon ~ # lspci | grep audio

0000:00:0d.0 Multimedia audio controller: Creative Labs SB Audigy (rev 03)

```

/dev/mixer :

```

Demon ~ # ls -la /dev/mixer

lrwxrwxrwx  1 root root 11 Oct 27  2005 /dev/mixer -> sound/mixer

Demon ~ # ls -la /dev/sound/mixer

crw-rw----  1 root audio 14, 0 Oct 27  2005 /dev/sound/mixer

```

Error when executing microphone_config :

```

Demon ~ # microphone_config

No mixer devices available!

Please purchase a sound card and install it!

```

In my kernel (2.6.13-gentoo-r3) I have this selected:

Device Drivers -> Sound -> Advanced Linux Sound Architecture ->

<*> Advanced Linux Sound Architecture

<*>  Sequencer support

<*>  OSS Mixer API

<*>  OSS PCM (digital audio) API

PCI devices ->

<*> Emu10k1 (SB Live!, Audigy, E-mu APS)

I hope this can help clear up why I can't run microphone_config.. And, I know that my microphone works. When I talk into the microphone I can hear it in the speakers.

Any ideas?

----------

## abaelinor

aaLast edited by abaelinor on Tue Oct 21, 2008 4:37 am; edited 1 time in total

----------

## gravedigga_23

i wanna tell my pc commands like louder or something like that. so i try cvoicecontrol.

but i cant get microphone_config to work.

it always fails only at the "Calculate Recording thresholds".

is there anywhere a log? or should i try another software like sphinx (i wasnt be able to find a good howto)?

would be nice if anyone could help me with his experiences.

----------

## Hydraulix

My only issue (for right now) is the mic is always on. Is there a way that I can have it set to auto?

----------

