Re: accessible_output2 to a audio file in python
The following is the most minimalistic example of what I think you want and probably what BGT does. In production you may want to output to a SpMemoryStream, get the data with GetData() and trim the silence.
I didn't even bother importing accessible_output2 since it really wasn't necessary. If you would like to maintain currently set attributes of a sapi5 instance (rate/pitch/voice), however, set sapi to the object attribute.
sapi = win32com.client.Dispatch("sapi.SpVoice")
becomes
from accessible_output2.outputs.sapi5 import SAPI5
s = SAPI5()
# set stuff
sapi = s.object
import win32com.client
sapi = win32com.client.Dispatch("sapi.SpVoice") stream = win32com.client.Dispatch("sapi.SpFileStream") # SSFMCreateForWrite = 3 stream.Open("test.wav", 3, False) sapi.AudioOutputStream = stream sapi.Speak("test") stream.Close()
-- Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector