Program/Program.Tts.cscsharp

Documentation

Program

Console host for the Version 3 Lilith chat session.

Program.cs

  • Sets UTF-8 console output and window title.
  • Attempts KokoroTts setup (speech after replies); continues without TTS on failure.
  • BootAsync then loops on user input until exit or slash commands.
using System;using System.Threading.Tasks;using Agent.Core.Logging;using Agent.Core.TextToSpeech;namespace LilithConsole{    internal static class ConsoleTts    {        internal static async Task SpeakReplyAsync(KokoroTts? tts, Logger logger, string? reply)        {            if (tts is null || string.IsNullOrWhiteSpace(reply))            {                return;            }            try            {                await tts.SpeakAsync(reply).ConfigureAwait(false);            }            catch (Exception ex)            {                logger.WriteLine("TTS", $"Speech failed: {ex.Message}", LogColors.Orange);            }        }    }}