Thread: Error in Generating Voice using SAPI 5.1

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    2

    Error in Generating Voice using SAPI 5.1

    hi,

    i am using Microsoft Speech SDK 5.1,
    (WindowsXP, VC++ IDE)


    I have wrote program which Speaks as per Given Text, but i m getting errors.

    My code is

    #include <stdio.h>
    #include <conio.h>
    #include <sapi.h>
    #include <objbase.h>

    int main()
    {

    HRESULT hr;

    ISpVoice *pVoice = NULL;


    if (FAILED(CoInitialize(NULL)))
    printf("Error to intiliaze COM");
    else
    printf("ISpVoice Initialized\n\n");

    hr = CoCreateInstance(&CLSID_SpVoice, NULL, CLSCTX_ALL, &IID_ISpVoice, (void **)&pVoice);

    if(SUCCEEDED(hr))
    {
    hr = pVoice->Speak("Hello world", SPF_DEFAULT, NULL);

    if ( pVoice != NULL )
    pVoice->Release();

    pVoice = NULL;
    }

    CoUninitialize();

    getch();

    return 0;
    }

    Errors are :

    1)

    error C2039: 'Speak' : is not a member of 'ISpVoice'
    c:\program files\microsoft speech sdk 5.1\include\sapi.h(6992) : see declaration of 'ISpVoice'

    2) error C2039: 'Release' : is not a member of 'ISpVoice'
    c:\program files\microsoft speech sdk 5.1\include\sapi.h(6992) : see declaration of 'ISpVoice'


    i am new in Multimedia area. i want to know that is it possible to generate Wave file using C code. can anybody guide me, or provide me link from where i can get better idea to generate wave file using C
    Last edited by lakul; 03-13-2009 at 05:04 AM. Reason: Specification of "Notification Type:"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Doxygen failing
    By Elysia in forum A Brief History of Cprogramming.com
    Replies: 19
    Last Post: 04-16-2008, 01:24 PM