Description

Change voice

Changes the text-to-speech (TTS) voice. Listen to a preview of each voice below.

Name Preview
af_heart
af_bella
af_sarah
af_nicole
af_sky
am_adam
am_michael
bf_emma
bf_isabella
bm_george
bm_lewis

Included in Version 6

How to register ChangeVoiceToolcsharp
registry.Register(new AgentTool(            Name,            "Changes the text-to-speech (TTS) voice. Available voices include: af_heart, af_bella, af_sarah, af_nicole, af_sky, am_adam, am_michael, bf_emma, bf_isabella, bm_george, bm_lewis.",            args => Invoke(registry, args),            ParametersSchema));
Helper classes for ChangeVoiceToolcsharp
    private static string Invoke(ToolRegistry registry, string argumentsJson)    {        string voice = ParseVoice(argumentsJson);        if (string.IsNullOrWhiteSpace(voice))        {            return "Error: Provide a voice ID (JSON property \"voice\").";        }        try        {            registry.InvokeVoiceChanged(voice);            return $"Success: TTS voice changed to '{voice}'.";        }        catch (Exception ex)        {            return $"Error changing voice: {ex.Message}";        }    }