This commit is contained in:
Saifeddine ALOUI 2024-05-18 23:22:32 +02:00
parent 09266fd5c6
commit e79dfa674a
2 changed files with 3 additions and 22 deletions

View File

@ -99,26 +99,7 @@ def add_events(sio:socketio):
def stop_audio_stream(sid):
client = check_access(lollmsElfServer, sid)
lollmsElfServer.info("Stopping audio capture")
text = lollmsElfServer.audio_cap.stop_recording()
if lollmsElfServer.config.debug:
ASCIIColors.yellow(text)
ai_text = lollmsElfServer.receive_and_generate(text["text"], client)
if lollmsElfServer.tts and lollmsElfServer.tts.ready:
personality_audio:Path = lollmsElfServer.personality.personality_package_path/"audio"
voice=lollmsElfServer.config.xtts_current_voice
if personality_audio.exists() and len([v for v in personality_audio.iterdir()])>0:
voices_folder = personality_audio
elif voice!="main_voice":
voices_folder = lollmsElfServer.lollms_paths.custom_voices_path
else:
voices_folder = Path(__file__).parent.parent.parent/"services/xtts/voices"
language = lollmsElfServer.config.xtts_current_language# convert_language_name()
lollmsElfServer.tts.set_speaker_folder(voices_folder)
preprocessed_text= add_period(ai_text)
voice_file = [v for v in voices_folder.iterdir() if v.stem==voice and v.suffix==".wav"]
lollmsElfServer.tts.tts_to_audio(preprocessed_text, voice_file[0].name, language=language)
lollmsElfServer.audio_cap.stop_recording()

@ -1 +1 @@
Subproject commit 00a3487d2b943ecee6fa5afefa358d88367907b1
Subproject commit c680f0de07132b93bc7898b5ded022e67eb88e47