feat: add talk voice alias map
This commit is contained in:
@@ -221,3 +221,32 @@ describe("talk api key fallback", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("talk.voiceAliases", () => {
|
||||
it("accepts a string map of voice aliases", async () => {
|
||||
vi.resetModules();
|
||||
const { validateConfigObject } = await import("./config.js");
|
||||
const res = validateConfigObject({
|
||||
talk: {
|
||||
voiceAliases: {
|
||||
Clawd: "EXAVITQu4vr4xnSDxMaL",
|
||||
Roger: "CwhRBWXzGAHq8TQ4Fs17",
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects non-string voice alias values", async () => {
|
||||
vi.resetModules();
|
||||
const { validateConfigObject } = await import("./config.js");
|
||||
const res = validateConfigObject({
|
||||
talk: {
|
||||
voiceAliases: {
|
||||
Clawd: 123,
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(res.ok).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -222,6 +222,8 @@ export type CanvasHostConfig = {
|
||||
export type TalkConfig = {
|
||||
/** Default ElevenLabs voice ID for Talk mode. */
|
||||
voiceId?: string;
|
||||
/** Optional voice name -> ElevenLabs voice ID map. */
|
||||
voiceAliases?: Record<string, string>;
|
||||
/** Default ElevenLabs model ID for Talk mode. */
|
||||
modelId?: string;
|
||||
/** Default ElevenLabs output format (e.g. mp3_44100_128). */
|
||||
@@ -815,6 +817,7 @@ const ClawdisSchema = z.object({
|
||||
talk: z
|
||||
.object({
|
||||
voiceId: z.string().optional(),
|
||||
voiceAliases: z.record(z.string(), z.string()).optional(),
|
||||
modelId: z.string().optional(),
|
||||
outputFormat: z.string().optional(),
|
||||
apiKey: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user