Sort of working
This commit is contained in:
15
display.py
15
display.py
@@ -259,8 +259,21 @@ def _lerp_color(c1: tuple, c2: tuple, t: float) -> tuple:
|
||||
return tuple(int(c1[i] + (c2[i] - c1[i]) * t) for i in range(3))
|
||||
|
||||
|
||||
_PIPER_MODEL = '/home/dfr84/Python/JARVIS/en_GB-alan-medium.onnx'
|
||||
|
||||
def _speak(text: str) -> None:
|
||||
subprocess.run(['espeak-ng', '-s', '150', text], capture_output=True)
|
||||
piper = subprocess.Popen(
|
||||
['piper', '--model', _PIPER_MODEL, '--output_raw'],
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
raw, _ = piper.communicate(input=text.encode())
|
||||
subprocess.run(
|
||||
['aplay', '-r', '22050', '-f', 'S16_LE', '-t', 'raw', '-'],
|
||||
input=raw,
|
||||
capture_output=True,
|
||||
)
|
||||
|
||||
|
||||
def _handle_command(raw: bytes, n_ch: int, native_hz: int) -> None:
|
||||
|
||||
Reference in New Issue
Block a user