TTS如何转化成WAV?(200分)

  • 主题发起人 主题发起人 zhaonaldo
  • 开始时间 开始时间
Z

zhaonaldo

Unregistered / Unconfirmed
GUEST, unregistred user!
我看过VB的例子程序,可是翻译成Delphi以后无效,有那位大虾可以给一个例子程序?
最好有那种不用发音就可以直接转化的功能,再三感谢先!
 
没有人能回答吗?各位高手请帮帮忙
 
好象TTS本身带的文档中有,不过全是E文,你可查查看
 
HRESULT hr = S_OK;
CComPtr <ISpVoice> cpVoice;
CComPtr <ISpStream> cpStream;
CSpStreamFormat cAudioFmt;

//Create a SAPI Voice
hr = cpVoice.CoCreateInstance( CLSID_SpVoice );

//Set the audio format
if(SUCCEEDED(hr))
{
hr = cAudioFmt.AssignFormat(SPSF_22kHz16BitMono);
}

//Call SPBindToFile, a SAPI helper method, to bind the audio stream to the file
if(SUCCEEDED(hr))
{

hr = SPBindToFile( L攃://ttstemp.wav? SPFM_CREATE_ALWAYS,
&amp;cpStream, &amp
cAudioFmt.FormatId(),cAudioFmt.WaveFormatExPtr() );
}

//set the output to cpStream so that the output audio data will be stored in cpStream
if(SUCCEEDED(hr))
{
hr = cpVoice->SetOutput( cpStream, TRUE );
}

//Speak the text 揾ello world?synchronously
if(SUCCEEDED(hr))
{
hr = cpVoice->Speak( L"Hello World", SPF_DEFAULT, NULL );
}

//close the stream
if(SUCCEEDED(hr))
{
hr = cpStream->Close();
}

//Release the stream and voice object
cpStream.Release ();
cpVoice.Release();
这一段如何翻译成Delphi,请指教
 
后退
顶部