Jade-Voice/voice.py
Dani 473da1b4ec First Commit
PocketSphinx Just Barely works to recoginze 'Jade' as the wake word
Using https://github.com/suno-ai/bark for the TTS part of the code
2023-05-08 23:07:33 -04:00

14 lines
416 B
Python

import sounddevice as sd
import numpy as np
from bark import generate_audio, SAMPLE_RATE, preload_models
preload_models()
def say(text):
audio_array = generate_audio(text, history_prompt="v2/en_speaker_9")
audio_array = np.expand_dims(audio_array, axis=1)
stream = sd.OutputStream(samplerate=SAMPLE_RATE, channels=1)
stream.start()
stream.write(audio_array)
stream.stop()
stream.close()