Example Code

Voice Recognition Data Acquisition

Code and Documents

Attachment

Overview

This VI demonstrates how to use Windows Speech Recognition to control a data acquisition application

 

 

Description

The Speech API can be called from LabVIEW to create any speech recognition application, in this case, data acquisition. The Speech API is part of the .NET Framework which in most cases is already installed on computers running Windows XP or Vista OS or later. In general the API will automatically “listen” for key phrases, perform voice recognition analysis on the audio stream, and will also convert text to speech.

 

For more info visit:http://www.microsoft.com/speech/speech2007/default.mspx

 

 

Requirements

Software

  • LabVIEW 2012 (or compatible)
  • .Net Framework 3.5 (or compatible)
  • Speech API version 5.3 (or compatible)

Hardware

  • Microphone

 

 Steps to Implement or Execute Code
1. Configure your Windows Speech Recognition and train your computer to your voice
2. Run this VI
3. Say loudly one the Phrases in the list (Check the block Diagram for more information)
4. Exit this VI

 

 

Additional Notes or References

Front panel of main application:

FP.PNG

 

Block Diagram

BD.PNG

For assistance with navigating the Speech API commands, check out Microsoft's MSDN site (http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx), where you can find to find lots of code snippets and descriptions of all the speech functions.

 

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
tarif
Member
Member
on

i am a mechatronics engineering and i have a task to control a motor completely by speech recognition .... and i tried to run your code but i didn't run because some files are missing ... so can you help me with that

tarif

Micael_
Active Participant
Active Participant
on

Hi all.

I tried this code, and after removing the missing VI, I still got an error : "The language for the grammar does not match the language of the speech recognizer.".

I guess it was due to the french version of XP I am using.

To fix the problem, I set the GrammarBuilder culture to "en-US" and the code is working fine now.

Hope this helps.

Micael.

Culture.png

Cordialement,


Micaël DA SILVA
ardee3949
Member
Member
on

It would be great if you upload the missing .vi ..

Micael_
Active Participant
Active Participant
on

Hi ardee,

You don't need the temperature VI to run the example. As it commects to hardware, it wouldn't work anyway.

All you have to do is just replacing it with the random number function and run the example to see how it works.

Cordialement,


Micaël DA SILVA
deepAg
Member
Member
on

Hello

I am attempting to do a similar project. I tried running ur VI, it is running without error but inputs from windows voice recog is not working with the program.

Ex: when i say start, it goes to windows start instead of controlling the vi.

Will be very thankfull, if u can reply asap.

NJKirchner
Active Participant
Active Participant
on

For reference, the .NET speech API has been neatly packaged up within the LVSpeak / GSpeak library available here

http://lavag.org/topic/15955-labview-speak-basic/

Please reply there or contact me directly if there are any challenges getting it up and running.

This should aid anyone just trying to get basic Speech detection integrated into LabVIEW

meriem1991
Member
Member
on

hi

some files are missing .can you upload the missing VI

luisalor
Member
Member
on
mohmdth120
Member
Member
on

hi >>>>>>

can you help me to upload my code to arduino (i use makerhub library):::::::::

and thanks

NJKirchner
Active Participant
Active Participant
on

Mohmdth,

I think you may have posted to the wrong forum.

shammer
Member
Member
on

I had issues getting Micael's code working. Apparently on my system (running Win7) I can't read the CultureInfo class (System.Globalization.CultureInfo).

 

I worked around it by reading the Culture from SpeechRecognizer then using that to set the culture of the newly-created GrammarBuilder:

SpeechRecognizer culture reading to set GrammarBuilder culture.png

Contributors