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
This commit is contained in:
14
voice.py
Normal file
14
voice.py
Normal file
@ -0,0 +1,14 @@
|
||||
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()
|
Reference in New Issue
Block a user