Example Code

LabVIEW Speech using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Using the .NET Connectivity features in LabVIEW we are able to create a SpeechSynthesizer class instance and ask it to read aloud our text

 

Description

The attached is a small LabVIEW Project of example code that performs some basic, and some more advanced, calls to the Speech Synthesizer assembly.

  1. Speak Text: This simple example uses the SpeechSynthesizer assembly to read the provided text using all default parameters. It's been configured to be called as a convenient subVI for placement in any code segment.
  2. Speak and Highlight: This more advanced example uses the .NET callback event capabilities in LabVIEW to receive event messages from the Speech Synthesizer assembly to perform asynchronous updates during speech. The text in the string control is highlighted whilst the text is spoken by the assembly through the use of the "SpeakProgress" event. 
  3. Voltage Reading Example: This VI draws upon a few more features of the SpeechSynthizer assembly to collate and allow voice selection, speed and volume. This is packaged into a pseudo-voltmeter example, demonstrating one potential use for speech synthesis in LabVIEW. 

Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Run the VI

 

Additional Information or References

Front Panel

FP.JPGFP1.JPG

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

Thoric (CLA, CLED, CTD and LabVIEW Champion)


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

Comments
AMIEL28
Member
Member
on

Thank you sharing this Thoric, May is ask something is it possible in labview that the utter voice in english can be converted into mandarin laguage if its possible what are the requirements that i need to do?

God bless

Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Hi Amiel, according to MSDN you can alter the culture of the voice using the Speak.Prompt class, and provide the culture information using the PromptBuilder. However, I've not done this myself so I can't really offer any more advice. MSDN is very detailed however, so I suggest you start there.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

OK, so I got curious, and I've looked at this. You can call the GetInstalledVoices method of SpeechSynthesizer to list all the Voices (cultures) installed on your OS. You can then use the Speak.PromptBuilder method to set a particular culture in a PromptBuilder class. Unfortunately my Windows 7 is Pro, not Ultimate or Enterprise, so I don't have any other languages installed to test this - I get back just "en" for English.

SpeechForeign.png

Thoric (CLA, CLED, CTD and LabVIEW Champion)


AMIEL28
Member
Member
on

Thank you for the response ill try that one i let you know i suceeded... Till then have a nice day an more power to you

hichem55
Member
Member
on

Thank you for this interesting topic, i spent too much time working on  a solution to select other language than English but i failed , did you find the solution?

Pradnya21
Member
Member
on

I am also working on text to speech conversion. I want the speech to be uttered only once when run continuously. So Is there any solution avaliable for this? pls do reply!!