-
Notifications
You must be signed in to change notification settings - Fork 691
Expose tts volume and pitch to the user code like we do with lang. #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
src/aiy/audio.py
Outdated
""" | ||
global _tts_volume |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove - these aren't required in this function, as it uses get_*_volume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sorry about that. Didn't do much python programming yet.
src/aiy/_drivers/_tts.py
Outdated
@@ -20,6 +20,7 @@ | |||
import subprocess | |||
import tempfile | |||
from aiy import i18n | |||
from aiy import audio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove - this creates a circular import between the two modules, which could lead to confusing problems later.
src/aiy/_drivers/_tts.py
Outdated
return functools.partial(say, player, lang=lang) | ||
volume = audio.get_tts_volume() | ||
pitch = audio.get_tts_pitch() | ||
return functools.partial(say, player, lang=lang, volume=volume, pitch=pitch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest ignoring volume and pitch here and letting say()
handle it.
Merged - works like a charm! Thank you for contributing. |
No problem. This benefits me too :). |
Summary of changes: - Fix instructions for using the Voice Kit on Stretch (google#187) - Make it easier to turn the LED off (google#167) - Fix crash with trigger sound (google#163) - Let user code control TTS (google#185) - Enable hotwording with Cloud Speech (0b4972b)
Summary of changes: - Fix instructions for using the Voice Kit on Stretch (google#187) - Make it easier to turn the LED off (google#167) - Fix crash with trigger sound (google#163) - Let user code control TTS (google#185) - Enable hotwording with Cloud Speech (0b4972b) Change-Id: Icfad0fadeaeb63417413c598763eceddb5bd0b9c
Summary of changes: - Fix instructions for using the Voice Kit on Stretch (google#187) - Make it easier to turn the LED off (google#167) - Fix crash with trigger sound (google#163) - Let user code control TTS (google#185) - Enable hotwording with Cloud Speech (0b4972b) - Update to Cloud Speech v1 (google#206)
Summary of changes: - Fix instructions for using the Voice Kit on Stretch (google#187) - Make it easier to turn the LED off (google#167) - Fix crash with trigger sound (google#163) - Let user code control TTS (google#185) - Enable hotwording with Cloud Speech (0b4972b)
Like the title says, this will expose the volume and pitch for tts to the user code.
It can be set/get globally with:
Or set individually with say: