Click here to Skip to main content
15,914,338 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Who to make a package ? Pin
Rajesh R Subramanian21-Feb-07 23:33
professionalRajesh R Subramanian21-Feb-07 23:33 
AnswerRe: Who to make a package ? Pin
Hans Dietrich21-Feb-07 22:13
mentorHans Dietrich21-Feb-07 22:13 
GeneralRe: Who to make a package ? Pin
Suresh H21-Feb-07 22:15
Suresh H21-Feb-07 22:15 
GeneralRe: Who to make a package ? Pin
toxcct21-Feb-07 22:18
toxcct21-Feb-07 22:18 
AnswerRe: Who to make a package ? Pin
Hamid_RT22-Feb-07 0:20
Hamid_RT22-Feb-07 0:20 
QuestionRe: Who to make a package ? Pin
David Crow22-Feb-07 2:37
David Crow22-Feb-07 2:37 
AnswerRe: Who to make a package ? Pin
Mark Salsbery22-Feb-07 5:50
Mark Salsbery22-Feb-07 5:50 
QuestionMS Speech SDK: No sound can be heard while a .wav file being processed? Pin
chocm21-Feb-07 21:10
chocm21-Feb-07 21:10 
New to the text-to-speech program, I begin with the basic speech SDK API.

Below is the code which designed function is to read "Hello world!" and save the speech into output.wav.
I had hoped I could heard the pronunciation of the words, meanwhile the data for the voice
could be processed into .wav file. However, the result of the running of the program is that I heard
nothing, only get the output.wav, so my question is how can I get the sound to be heard and simultaneously get

the process for the outputing the sound into wave file ?

Thanks for any help!



-----------------------------------------------------------------------------------


#include <sapi.h>
#include <sphelper.h>


#pragma comment(lib,"ole32.lib")
#pragma comment(lib,"sapi.lib")

int main(int argc, char* argv[])
{
ISpVoice * pVoice = NULL;


if (FAILED(::CoInitialize(NULL)))
return FALSE;


HRESULT hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void **)&pVoice);
if( SUCCEEDED( hr ) )
{

CComPtr<ispstream> cpWavStream;
CComPtr<ispstreamformat> cpOldStream;
CSpStreamFormat OriginalFmt;
pVoice->GetOutputStream( &cpOldStream );
OriginalFmt.AssignFormat(cpOldStream);
hr = SPBindToFile( L"c:\\output.wav",SPFM_CREATE_ALWAYS,&cpWavStream,&OriginalFmt.FormatId(), \
OriginalFmt.WaveFormatExPtr() );
if( SUCCEEDED( hr ) )
{
pVoice->SetOutput(cpWavStream,TRUE);
WCHAR WTX[] = L"<voice required="\"gender=female\"">Hello world!";
pVoice->Speak(WTX, SPF_IS_XML, NULL);
pVoice->WaitUntilDone( INFINITE );

pVoice->Release();
pVoice = NULL;

}


}
::CoUninitialize();
return TRUE;
}




The list for the Internet telephone service providers
GeneralRe: MS Speech SDK: No sound can be heard while a .wav file being processed? Pin
Programm3r22-Feb-07 3:08
Programm3r22-Feb-07 3:08 
QuestionProblem with FTP application [modified] Pin
Sameer_Thakur21-Feb-07 20:03
Sameer_Thakur21-Feb-07 20:03 
GeneralRe: Problem with FTP application Pin
Programm3r21-Feb-07 20:33
Programm3r21-Feb-07 20:33 
GeneralRe: Problem with FTP application Pin
Sameer_Thakur21-Feb-07 23:32
Sameer_Thakur21-Feb-07 23:32 
AnswerRe: Problem with FTP application Pin
David Crow22-Feb-07 2:39
David Crow22-Feb-07 2:39 
GeneralRe: Problem with FTP application Pin
Programm3r22-Feb-07 2:46
Programm3r22-Feb-07 2:46 
GeneralRe: Problem with FTP application Pin
David Crow22-Feb-07 2:53
David Crow22-Feb-07 2:53 
GeneralRe: Problem with FTP application Pin
Programm3r22-Feb-07 3:01
Programm3r22-Feb-07 3:01 
GeneralRe: Problem with FTP application Pin
JudyL_MD22-Feb-07 8:04
JudyL_MD22-Feb-07 8:04 
AnswerRe: Problem with FTP application Pin
Programm3r22-Feb-07 2:49
Programm3r22-Feb-07 2:49 
QuestionRe: Compile any projects through a project in a workspace Pin
dungpapai21-Feb-07 19:50
dungpapai21-Feb-07 19:50 
AnswerRe: Compile any projects through a project in a workspace Pin
prasad_som21-Feb-07 20:06
prasad_som21-Feb-07 20:06 
GeneralRe: Compile any projects through a project in a workspace Pin
dungpapai21-Feb-07 21:25
dungpapai21-Feb-07 21:25 
AnswerRe: Compile any projects through a project in a workspace Pin
prasad_som21-Feb-07 21:38
prasad_som21-Feb-07 21:38 
GeneralRe: Compile any projects through a project in a workspace Pin
dungpapai21-Feb-07 22:21
dungpapai21-Feb-07 22:21 
QuestionShellAbout() Question Pin
Programm3r21-Feb-07 18:54
Programm3r21-Feb-07 18:54 
AnswerRe: ShellAbout() Question Pin
prasad_som21-Feb-07 19:13
prasad_som21-Feb-07 19:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.