refactor(voice-call): drop unused voice lookup helpers · openclaw/openclaw@f913504
vincentkoc
·
2026-06-19
·
via Recent Commits to openclaw:main
File tree
extensions/voice-call/src
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3,8 +3,6 @@ import { describe, expect, it } from "vitest";
|
3 | 3 | import { |
4 | 4 | DEFAULT_POLLY_VOICE, |
5 | 5 | escapeXml, |
6 | | -getOpenAiVoiceNames, |
7 | | -isOpenAiVoice, |
8 | 6 | mapVoiceToPolly, |
9 | 7 | } from "./voice-mapping.js"; |
10 | 8 | |
@@ -23,11 +21,4 @@ describe("voice mapping", () => {
|
23 | 21 | expect(mapVoiceToPolly("unknown")).toBe(DEFAULT_POLLY_VOICE); |
24 | 22 | expect(mapVoiceToPolly(undefined)).toBe(DEFAULT_POLLY_VOICE); |
25 | 23 | }); |
26 | | - |
27 | | -it("detects known openai voices and lists them", () => { |
28 | | -expect(isOpenAiVoice("nova")).toBe(true); |
29 | | -expect(isOpenAiVoice("NOVA")).toBe(true); |
30 | | -expect(isOpenAiVoice("Polly.Joanna")).toBe(false); |
31 | | -expect(getOpenAiVoiceNames()).toEqual(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]); |
32 | | -}); |
33 | 24 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -50,17 +50,3 @@ export function mapVoiceToPolly(voice: string | undefined): string {
|
50 | 50 | // Map OpenAI voices to Polly equivalents |
51 | 51 | return OPENAI_TO_POLLY_MAP[normalizeLowercaseStringOrEmpty(voice)] || DEFAULT_POLLY_VOICE; |
52 | 52 | } |
53 | | - |
54 | | -/** |
55 | | - * Check if a voice name is a known OpenAI voice. |
56 | | - */ |
57 | | -export function isOpenAiVoice(voice: string): boolean { |
58 | | -return normalizeLowercaseStringOrEmpty(voice) in OPENAI_TO_POLLY_MAP; |
59 | | -} |
60 | | - |
61 | | -/** |
62 | | - * Get all supported OpenAI voice names. |
63 | | - */ |
64 | | -export function getOpenAiVoiceNames(): string[] { |
65 | | -return Object.keys(OPENAI_TO_POLLY_MAP); |
66 | | -} |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。