Do a newspaper dictation software usually give the child dictation is too much trouble. Haha support Chinese English

Source: Internet
Author: User

The main use of the TTS speech reading SDK

Recently played a lot of voice reading, but also in two of software applications. In fact, most of the voice reading code is still very good to write, just like to determine whether TTS voice reading is over or the current voice engine state slightly to find the parameters. Here's a record:

Originally found on the internet on the Judge TTS reading completion event code WaitForSingleObject (SpVoice. Speakcompleteevent, 200), in the use of Delphi did not achieve the original seemingly should have the effect, the test found that this thing is only in TTS synthesis read stream after the return, White is the TTS just to read aloud, was judged to read aloud completed. Carefully looked up the parameters of the SpVoice, there is a Statdus property, the returned object can be obtained some useful property parameters such as: runningstate (Running state), Inputwordlegth (read aloud the sum of all the words of the sentence length), Inputwordposition (at the end of the current spoken word) ...

Where Runningstate has three states: read aloud text is fully rendered after the composition is returned Srsedone = 1 is being read aloud will return srseisspeaking = 2 Pause reading will return 0

Use these three properties to determine whether the reading is completed, add two timers, read the beginning of the sentence, start judging the reading state of the timer, complete and then reactivate the timer to read aloud:

Procedure Tform1.timer1timer (Sender:tobject);
Begin
Timer1. Enabled:=false;
Learntts.speak (' This is the VOA Explorations in Special english! ', 1);
WaitForSingleObject (learntts.speakcompleteevent, 200);
Timer2. Enabled:=true;
End

Procedure Tform1.timer2timer (Sender:tobject);
Begin
Edit1. Text:=inttostr (learnTTS.Status.RunningState);
If learntts.status.runningstate=1 then//read aloud when finished will return 1
Timer1. Enabled:=true;
End

Do a newspaper dictation software usually give the child dictation is too much trouble. Haha support Chinese English

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.