CodePudding user response:
Oleobject objFileStreamObjFileStream=CREATE OLEObject
ObjFileStream. ConnectToNewObject (" SAPI. SpFileStream ")
ObjFileStream. Format. Type="6"//"SAFT8kHz16BitMono
"ObjFileStream. Open (' d: \ test. Wav, 3, False)
Mytts. AllowAudioOutputFormatChangesOnNextSet=False
Mytts. AudioOutputStream=objFileStream
Mytts. Speak (mle_read. Text, 1)
Mytts. WaitUntilDone (1)
ObjFileStream. Close ()
CodePudding user response:
ObjFileStream. Format. Type="6"//"SAFT8kHz16BitMono"
//Standard PCM wave formats
SAFT8kHz8BitMono=4
SAFT8kHz8BitStereo=5
SAFT8kHz16BitMono=6
SAFT8kHz16BitStereo=7
SAFT11kHz8BitMono=8
SAFT11kHz8BitStereo=9
SAFT11kHz16BitMono=10
SAFT11kHz16BitStereo=11
SAFT12kHz8BitMono=12
SAFT12kHz8BitStereo=13
SAFT12kHz16BitMono=14
SAFT12kHz16BitStereo=15
SAFT16kHz8BitMono=16
SAFT16kHz8BitStereo=17
SAFT16kHz16BitMono=18
SAFT16kHz16BitStereo=19
SAFT22kHz8BitMono=20
SAFT22kHz8BitStereo=21
SAFT22kHz16BitMono=22
23 SAFT22kHz16BitStereo=
SAFT24kHz8BitMono=24
SAFT24kHz8BitStereo=25
SAFT24kHz16BitMono=26
SAFT24kHz16BitStereo=27
SAFT32kHz8BitMono=28
SAFT32kHz8BitStereo=29
SAFT32kHz16BitMono=30
SAFT32kHz16BitStereo=31
SAFT44kHz8BitMono=32
SAFT44kHz8BitStereo=33
SAFT44kHz16BitMono=34
SAFT44kHz16BitStereo=35
SAFT48kHz8BitMono=36
SAFT48kHz8BitStereo=37
SAFT48kHz16BitMono=38
SAFT48kHz16BitStereo=39