mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 20:40:43 +00:00
fix(tts): migrate legacy edge config in doctor
This commit is contained in:
@@ -184,27 +184,6 @@ describe("buildMicrosoftSpeechProvider", () => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
it("accepts legacy providers.edge voice config", () => {
|
||||
const provider = buildMicrosoftSpeechProvider();
|
||||
|
||||
const resolved = provider.resolveConfig?.({
|
||||
cfg: TEST_CFG,
|
||||
rawConfig: {
|
||||
provider: "edge",
|
||||
providers: {
|
||||
edge: {
|
||||
voice: "en-US-AvaNeural",
|
||||
},
|
||||
},
|
||||
},
|
||||
timeoutMs: 1000,
|
||||
});
|
||||
|
||||
expect(resolved).toMatchObject({
|
||||
voice: "en-US-AvaNeural",
|
||||
});
|
||||
});
|
||||
|
||||
it("switches to a Chinese voice for CJK text when no explicit voice override is set", async () => {
|
||||
const provider = buildMicrosoftSpeechProvider();
|
||||
const edgeSpy = vi.spyOn(ttsModule, "edgeTTS").mockImplementation(async ({ outputPath }) => {
|
||||
|
||||
@@ -59,9 +59,8 @@ function normalizeMicrosoftProviderConfig(
|
||||
const providers = asObject(rawConfig.providers);
|
||||
const rawEdge = asObject(rawConfig.edge);
|
||||
const rawMicrosoft = asObject(rawConfig.microsoft);
|
||||
const rawProviderEdge = asObject(providers?.edge);
|
||||
const rawProviderMicrosoft = asObject(providers?.microsoft);
|
||||
const raw = { ...rawEdge, ...rawProviderEdge, ...rawMicrosoft, ...rawProviderMicrosoft };
|
||||
const raw = { ...rawEdge, ...rawMicrosoft, ...rawProviderMicrosoft };
|
||||
const outputFormat = trimToUndefined(raw.outputFormat);
|
||||
return {
|
||||
enabled: asBoolean(raw.enabled) ?? true,
|
||||
|
||||
Reference in New Issue
Block a user