Skip to content

Commit

Permalink
Update audio settings and add voice selection in TTS function (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
S0L0GUY authored Jan 26, 2025
1 parent ae2d905 commit 4910f94
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nova.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def run_code():

def play_tts(text, output_device_index=constant.AUDIO_OUTPUT_INDEX):
engine = pyttsx3.init()
voices = engine.getProperty('voices')
for voice in voices:
if 'Zira' in voice.name:
engine.setProperty('voice', voice.id)
break
engine.setProperty('rate', 200) # Speed of speech
engine.setProperty('volume', 1) # Volume level (0.0 to 1.0)

Expand Down

0 comments on commit 4910f94

Please sign in to comment.