Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can’t have TTS independent from Talon trying to interpret voice commands from TTS audio. #41

Open
atljoseph opened this issue Oct 29, 2024 · 3 comments

Comments

@atljoseph
Copy link

I’m using sight free talon to produce TTS from talon ai tools functionality. But every time it does something “to speech”, talon thinks an actual voice command is being issued by User. It’s very frustrating. I thought the lib would have turned off the speech recognition, but it doesn’t on my Mac. When I use actions.speech.disable(), no TTS is generated. What Python code can I use to make Talon retain its mode but discard any captures? Speech_system.stop_listening() also prevents TTS from triggering. It’s kind of unusable as it is. Can’t have TTS independent from Talon getting triggered by TTS.

FYI, not using this for sight free functions. Just the tts.

@atljoseph atljoseph changed the title Can’t have TTS independent from Talon getting triggered by TTS. Can’t have TTS independent from Talon getting triggered by TTS and interpreting voice commands. Oct 29, 2024
@atljoseph atljoseph changed the title Can’t have TTS independent from Talon getting triggered by TTS and interpreting voice commands. Can’t have TTS independent from Talon trying to interpret voice commands from TTS audio. Oct 29, 2024
@C-Loftus
Copy link
Owner

Thanks for your message. The reason the speech is not toggled is that so the user can interrupt tts by speaking another command. Otherwise they would have to wait for the entire tts message to finish each time.

I think your two options would be to either upgrade your microphone to something with more noise isolation or use headphones.

@atljoseph
Copy link
Author

atljoseph commented Oct 29, 2024 via email

@C-Loftus
Copy link
Owner

C-Loftus commented Nov 1, 2024

That is valid. I only bring up headphones / mic since they are easier hardware ways that don't require disabling talon. At least for me, I found using lightweight apple earbuds fine for long periods of time but ymmv.

In my tinkering, I did not find disabling the mic to be practical. Since this repo is primarily for low vision/eye strain use where a user needs to interrupt tts, I probably won't add this myself, but if you have any context on your use case and what you like using tts for, feel free to let me know.

If you want to add this for you personal use, it should be fairly easy to fork the repo or override the tts function for your platform. Then right before the code that calls the tts, just run a subprocess command to disable the mic, and then enable it after tts is finished. i.e. osascript -e "set volume input volume 0" right before https://github.com/C-Loftus/sight-free-talon/blob/main/core/core-mac.py#L23 If you have another way you have figured out that works for your workflow, feel free to let me know.

In the future when talon gets a package manager I may split up this repo so the tts parts are separated from the screen reader parts so it is easier for others to tinker with

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants