Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7915563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:29:47+00:00 2026-06-03T14:29:47+00:00

Please can anyone help me? I search some example how can i get information

  • 0

Please can anyone help me? I search some example how can i get information about speeching text in TTS through SAPI (I am programming my aplication in C# but it is not needed, SAPI is the same in C++, etc.)
Information what I need is for example:
User will write in textbox:

"This is a Text"..

tts.Speak("This is a text"); // this will "read" it..

ok, nice… but I need too get informations about "timing"..

for example:

"Th" (first sound (phoneme) of "This") was "read" in 0.01ms..

"i" (first sound of "is") was "read" in 0.5ms..

"e" (second sound of "Text") was "read" in 1.02ms..

when I save the .wav file generated by SAPI, I need to get information about the timing in the .wav for subsequent "processing" of the wav file.

Sorry for my english and sorry for my bad description of my problem but the problem is i think very simple and all will understand it. If not I will try to describe the problem again 🙂 ^^..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:29:49+00:00Added an answer on June 3, 2026 at 2:29 pm

    I have used C++ and SAPI 5.1 to synthesize speech and have a virtual character move its lips accordingly. Here is some code that works with visemes. According to the documentation at http://msdn.microsoft.com/en-us/library/ms720164(v=vs.85).aspx, phonemes work the same, except replace SPEI_VISEME with SPEI_PHONEME.

    DWORD WINAPI Character::sayMessage(LPVOID lpParam){
        HRESULT hres;
        try{
            ::CoInitialize(NULL);
            ThreadParam * param = (ThreadParam *)lpParam;
            wstring s = param->message;
    
            //first check the string for null
            if (s == L"") return false;
    
            //http://msdn.microsoft.com/en-us/library/ms720163(VS.85,classic).asp is my source for this
            //set up text to speech
    
            //get the voice associated with the character
            ISpVoice * pVoice;
            pVoice = param->sceneObject->characterVoice;
    
            if (pVoice != NULL){
                pVoice->Speak( NULL, SPF_PURGEBEFORESPEAK, 0 );
    
                SPEVENT event;
                ULONG ul;
    
                pVoice->SetInterest(SPFEI(SPEI_VISEME)|SPFEI(SPEI_END_INPUT_STREAM),SPFEI(SPEI_VISEME)|SPFEI(SPEI_END_INPUT_STREAM));
                pVoice->SetNotifyCallbackFunction(&eventFunction,0,0);
                pVoice->WaitForNotifyEvent(INFINITE);
    
                if (param->sceneObject->age == CHILD){
                    s = L"<pitch middle=\"+10\">" + s + L"</pitch>";
                }
    
                hres = pVoice->Speak(s.c_str(),SPF_ASYNC,NULL);
    
                bool isDone = false;
                while(!isDone && pVoice != NULL && !FAILED(hres)){                  
                    if(pVoice->GetEvents(1,&event, &ul) == S_OK){
                        if(event.eEventId==SPEI_VISEME){
                            //get the viseme
                            int vis = LOWORD(event.lParam);  //handle it however you'd like after this
    
    
                        }
                        else if(event.eEventId== SPEI_END_INPUT_STREAM){
                            isDone = true;
                            s = L"";
                            return true;
                        }
                    }                   
                }
            }
        }
        catch(...){
            return false;
        }       
        return !FAILED(hres);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can anyone help me with a search through an array in php, please? $source
Can anyone please help. I am refreshing my knowledge of HTML and CSS (its
Can anyone please help me in getting the camerapreview frame data without clicking the
Can anyone please help me to create a custom drop down similar to the
Can anyone please help me to work out how to achieve the following? I
Can anyone please help me to add video controls (play, pause, forward, seekbar) to
Can anyone please help me with this...I'm not very good with regular expressions and
Can anyone please help me to understand how should i access json data in
Can anyone please help. I'm following a tutorial found here as I have a
Can anyone please help me how to convert string to date I have 3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.