Skip to content

Commit

Permalink
spd-say volume for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Mar 18, 2024
1 parent d35ab2c commit e0de81c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/core-linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,17 @@ def espeak(text: str):
rate = settings.get("user.tts_speed")
# convert -10 to 10 to -100 to 100
rate = rate * 10

# text = remove_special(text)

proc = subprocess.Popen(["spd-say", text, "--rate", str(rate)])
volume = settings.get("user.tts_volume")

# volume is from 1 to 100, convert it to -100 to 100
volume = int(volume - 50) * 2

proc = subprocess.Popen(
["spd-say", text, "--rate", str(rate), "--volume", str(volume)]
)
actions.user.set_cancel_callback(proc.kill)

def piper(text: str):
Expand Down

0 comments on commit e0de81c

Please sign in to comment.