SpeechLib_TLB控件功能
我在Delphi编写的软件中用到SpeechLib_TLB,声音软件XPSpeech.msi,可以发出的声音不好听,而且声音很小,想请问是哪方面的原因,是XPSpeech.msi软件的原因吗?需要购买发声收费软件吗?
[解决办法]
- Delphi(Pascal) code
unit Ifly_Stts;interfaceimplementation// 各种声音格式Const TTS_ADF_DEFAULT = 0; TTS_ADF_PCM8K8B1C = 1; TTS_ADF_PCM16K8B1C = 2; TTS_ADF_PCM8K16B1C = 3; TTS_ADF_PCM16K16B1C = 4; TTS_ADF_PCM11K8B1C = 5; TTS_ADF_PCM11K16B1C = 6; TTS_ADF_ALAW16K1C = 9; TTS_ADF_ULAW16K1C = 10; TTS_ADF_ALAW8K1C = 11; TTS_ADF_ULAW8K1C = 12; TTS_ADF_ALAW11K1C = 13; TTS_ADF_ULAW11K1C = 14; TTS_ADF_ADPCMG7218K4B1C = 17; TTS_ADF_ADPCMG7216K4B1C = 18; TTS_ADF_ADPCMG7233B1C = 19; TTS_ADF_ADPCMG7235B1C = 20; TTS_ADF_VOX6K1C = 21; TTS_ADF_VOX8K1C = 22;//文本内码 TTS_CP_GB2312 = 1 TTS_CP_GBK = 2 TTS_CP_UNICODE = 4//'参数类型 TTS_PARAM_LOCAL_BASE = &H0; TTS_PARAM_INBUFSIZE = &H1; TTS_PARAM_OUTBUFSIZE = &H2; TTS_PARAM_VID = &H3; TTS_PARAM_CODEPAGE = &H4; TTS_PARAM_AUDIODATAFMT = &H5; TTS_PARAM_SPEED = &H6; TTS_PARAM_AUDIOHEADFMT = &H7; TTS_PARAM_VOLUME = &H8; TTS_PARAM_PITCH = &H9;type//'================================================================//' STTS Api 声明//'================================================================//' 初始化function STTSInit():boolean;stdcall;external 'STTSApi.dll';//' 逆初始化function STTSDeInit():boolean;stdcall;external 'STTSApi.dll';//' 建立与TTS服务器的连接function STTSConnect(sSerialNumber:string;sServerIP:string):Integer;stdcall; external 'STTSApi.dll';//' 断开与TTS服务器的连接Function STTSDisconnect(hTTSInstance:Integer):boolean;stdcall; external 'STTSApi.dll';//' 设置本次连接的合成参数Function STTSSetParam(hTTSInstance:integer;lngType:integer;lngParam:integer):Boolean;stdcall; external 'STTSApi.dll';//' 获得本次连接的合成参数Function STTSGetParam(hTTSInstance:Integer;lngType:integer;lngParam:integer):Boolean;stdcall; external 'STTSApi.dll';//' 从字符串合成到音频文件Function STTSString2AudioFile(hTTSInstance:Integer;sString:string;sWaveFile:string):Boolean;stdcall; external 'STTSApi.dll';//' 从文本文件合成到音频文件Function STTSFile2AudioFile(hTTSInstance:Integer;sTextFile:string;sWaveFile:string):Boolean;stdcall; external 'STTSApi.dll';//'播放字符串Function STTSPlayString(hTTSInstance:Integer;sTextFile:string;bAsynch:Boolean):Boolean;stdcall; external 'STTSApi.dll';//'播放文本文件Function SSTTSPlayTextFile(hTTSInstance:Integer;sTextFile:string;bAsynch:Boolean):Boolean;stdcall; external 'STTSApi.dll';//'播放停止Function STTSPlayStop():Boolean;stdcall; external 'STTSApi.dll';//'查询播放状态Function STTSQueryPlayStatus(lngStatus:Integer):Boolean;stdcall; external 'STTSApi.dll';//'TTS版本信息Function STTSAbout(sAboutInfo:string;ninfosize:Integer):Boolean;stdcall; external 'STTSApi.dll';//' 用来获取错误代码的Windows API函数//Public Declare Function GetLastError Lib "kernel32" () As Longend;end.