Skip to content

Text to speech output for wake/sleep mode #1065

Answered by 0xphk
0xphk asked this question in Q&A
Discussion options

You must be logged in to vote

Managed to get this working, so I post it as answer, just in case one would like to add this too.

I' using mimic for text-to-speech output, so make sure this is installed or modify to use your preferred engine.

Added ~/.talon/user/tts.py which handles the text-to-speech output and display app notifications as well.

from talon import Module, app, actions
import os

mod = Module()

@mod.action_class
class Actions:
    def tts_enabled():
        """Sends tts listening"""
        os.system("mimic -t 'listening' -voice slt_hts")
        app.notify(body="Talon listening")

    def tts_disabled():
        """Sends tts talon disabled"""
        os.system("mimic -t 'sleeping' -voice slt_hts")
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by 0xphk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant