LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Text to speech method 2018

I am looking for a modern (Windows 10) method to convert text to speech in CVI. I have tried the 10 year old suggestions here in the forum without success.

Any help is much appreciated.

/Dan

0 Kudos
Message 1 of 6
(2,559 Views)

Thanks Kelly, for trying to help.

I have seen those posts. They are 10-15 years old, I was looking for some more up-to-date for current version of CVI and Windows OS.

As you can see two of them are not on subject, one for LabView and and stupid answer (have people time for such in this forum?).

 

Though, after some trial-and-error I now have some working code put in a DLL for easy use in CVI. I can share here if interested.

/Dan 

0 Kudos
Message 3 of 6
(2,506 Views)

danaxe,

 

Can you provide an example of what you are using or did? I am porting code from MAC OS X to labwindows on Windows 10 and need and easy text to speech function to use. I had used the MAC OS X API.

 

Like text_to_speech( const char * )

 

text_to_speech("Hello World");

 

Thanks for any feedback

0 Kudos
Message 4 of 6
(2,228 Views)

I have put together a package with dll and a test program.

Enjoy,

/Dan 

0 Kudos
Message 5 of 6
(2,207 Views)

Thanks,

 

I ended up finding this link and was able to accomplish without a DLL. I just followed the instructions and just used a portion.

 

https://wenku.baidu.com/view/24e02d3ee2bd960590c6771a.html

 

Had to Tools->Create ActiveX Controller, then open the ActiveX controller Wizard Choose Server, Select the Microsoft Speech Object Library, and renamed to TTS.fp as shown in above link. A TTS.h header file is created and just did the minimum.

 

Quite suprised how good it works. Solved all my issues. One thing though, since CA_InitActiveXThreadStyleForCurrentThread(0,COINIT_APARTMENTTHREADED); is needed per this thread.

 

https://forums.ni.com/t5/LabWindows-CVI/ActiveX-controls-cannot-be-created-in-a-thread-whose-concurr...

 

void speak_string( char *string )
{
long speech_volume = 100;
long speech_speed = 0; // -10 to 10
CAObjHandle appHandle = 0;

SpeechLib_NewISpeechVoice(NULL,1,LOCALE_NEUTRAL,0,&appHandle); // create a new voice function, the function is to call voice interface functions
SpeechLib_ISpeechVoiceSetVolume(appHandle,NULL,speech_volume); // this function sets the volume 0 to 100
SpeechLib_ISpeechVoiceSetRate(appHandle, NULL,speech_speed);
SpeechLib_ISpeechVoiceSpeak (appHandle, NULL, string, SpeechLibConst_SVSFlagsAsync, NULL); //Read the text
}

 

Hope this helps others. I downloaded the newest version 11 of what the article mentions for the Microsoft Speech Platform SDK 11 and the SpeechPlatformRuntime 11.

0 Kudos
Message 6 of 6
(2,204 Views)