★★将文本保存为音频文件(wav)的方法
准备控件:SpVoice,SpFileStream,SaveDialog,Button
Procedure TForm1.Button.click(sender:TObject);
begin
savedialog.filter:= 'wave文件|*.wav ';
if savedialog.execute then
begin
spfilestream.format.type_:=SAFT32KHz8BitMono;
spfilestream.open(savedialog1.filename,SSFMCreateForWrite,False);
SpVoice.allowAudioOutputFormatChangesOnNextSet:=false;
Spvoice.AudioOutputStream:=SpFilestream.defaultInterface;
SpVoice.Speak( '祝CSDN的朋友工作顺利! ',1);
SpVoice.waitUntilDone(-1);
Spfilestream.close;
end;
end;
摘自:http://topic.csdn.net/t/20031110/14/2445499.html 【8楼】
没有评论:
发表评论