uezo / aiavatarkit

🥰 Building AI-based conversational avatars lightning fast ⚡️💬
Apache License 2.0
257 stars 21 forks source link

Add experimental SpeechController to handle speech in separate process #33

Closed uezo closed 6 months ago

uezo commented 6 months ago

Introduced an experimental SpeechController to address the issue of popping noises during speech playback while concurrently receiving ChatGPT's stream. The SpeechController manages speech operations in a separate process, aiming to isolate and minimize audio disruptions. This modification is intended to enhance audio quality and stability during simultaneous stream reception and speech output.

You can use the new SpeechController by adding the following code after instantiate AIAvatar:

from aiavatar.speech.voicevox import VoicevoxSpeechControllerSubProcess
app.avatar_controller.speech_controller = VoicevoxSpeechControllerSubProcess(
    base_url="http://127.0.0.1:50021",
    speaker_id=46,
    device_index=app.output_device
)