Python how to get the raw audio data from SAPI?
Python how to get the raw audio data from SAPI? Philip recommended getting the raw audio samples when SAPI speaks and trimming the silence from the start, to help it speak faster.However, I encountered a problem doing that.What I have tried is this:# a script that tries to output SAPI and
Re: Python how to get the raw audio data from SAPI?
2020-02-06
Thread
AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector
Re: Python how to get the raw audio data from SAPI? I had the same issue, and the only solution I found was to create a new stream each time. It seems to be a relatively light operation though, at least it has not caused me any trouble thus far.BTW, beware of SAPI's horrible resampl
Re: Python how to get the raw audio data from SAPI?
Re: Python how to get the raw audio data from SAPI? Hi and thanks.It seems to work rather nicely.BTW, how are you outputting the audio? Direct X or something?Your screen reader wrapper manages all this stuff, right? URL: https://forum.audiogames.net/post/499179/#p499179 -- Audiogames
Re: Python how to get the raw audio data from SAPI?
Re: Python how to get the raw audio data from SAPI? Hi keithwipf1, can you post the script you've modified? Were you able to exclude even sounds slightly above 0?I have modified your script in this way and it works.# a script that tries to output SAPI and trim silence
Re: Python how to get the raw audio data from SAPI?
2020-02-06
Thread
AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector
Re: Python how to get the raw audio data from SAPI? BGT uses DirectSound. In my new engine, I am using Wasapi on Windows, CoreAudio on Mac and so on.Congratulations on getting this to work!Kind regards,Philip Bennefall URL: https://forum.audiogames.net/post/499186/#p499186
Re: Python how to get the raw audio data from SAPI?
Re: Python how to get the raw audio data from SAPI? I could be wrong on this, but I think there is a SAPI event, EndStream, which reports the length of the raw audio data that was written to the stream.That said, if I reset the stream to 0 every time I speak, I would be able to read the
Re: Python how to get the raw audio data from SAPI?
Re: Python how to get the raw audio data from SAPI? Hi keithwipf1 trying your script for how I modified it the sapi voice is reproduced, but it has the same latency as Sapi of Output Accessible2. I have now tried using sapi in a program written on pygame, and no known difference between
Re: Python how to get the raw audio data from SAPI?
Re: Python how to get the raw audio data from SAPI? Hi keithwipf1, trying your script for how I modified it, the sapi voice is reproduced, but it has the same latency as Sapi of Output Accessible2. I have now tried using sapi in a program written on pygame, and no known difference between
Re: Python how to get the raw audio data from SAPI?
Re: Python how to get the raw audio data from SAPI? Try this:from win32com.client.gencache import EnsureDispatchimport winsoundfrom wave import Wave_writefrom io import BytesIOvoice=EnsureDispatch("SAPI.SPVoice")while True: text=input("Enter text to speak") s
Re: Python how to get the raw audio data from SAPI?
2020-02-07
Thread
AudioGames . net Forum — Developers room : philip_bennefall via Audiogames-reflector
Re: Python how to get the raw audio data from SAPI? Most of the Microsoft voices have some lag, actually. This includes the Windows 10 voices.As for the event, I haven't investigated that. I might look into it when I revisit my Sapi backend at some point. However, while I don'