Noob Posted May 30, 2007 Posted May 30, 2007 This may not be possible, or it may just be way too complicated for an amateur like me. I looked at the sound-related functions in the Help file. As far as I understand them they can be used (only) in relation to actual sound files. My problem is I have a need to detect if the sound being played by the computer is generated by the text-to-speech function of Windows. A little bit of background: This is related to my freeware application which controls a third-party GPS navigation program. A user requested a feature which would mute his music (CD, MP3, etc) for the duration of the voice direction prompts given by the GPS navigation program (e.g. "Turn right in 1 mile"). Perhaps I could figure out how to mute the music, but I have no idea how to detect when the Windows Text-To-Speech engine (e.g. Microsoft Anna) is talking. Any feedback/help/suggestions will be greatly appreciated.
ibon Posted May 31, 2007 Posted May 31, 2007 $o_speech = ObjCreate( "SAPI.SpVoice" ) $o_speech.Speak( "Turn right in 1 mile", 1 ) If Not $o_speech.WaitUntilDone( 10 ) Then PAUSE_MUSIC( ) EndIf Do Sleep( 100 ) Until $o_speech.WaitUntilDone( 10 ) RESUME_MUSIC( ) $o_speech = "" =)
Noob Posted May 31, 2007 Author Posted May 31, 2007 Thanks much for trying to help, but looking at your code I realized I should have been clearer about the fact that the voice direction prompts are coming from the 3rd party GPS navigation software (not from my application). So I need to detect when Text-To-Speech is "talking".
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now