Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openclaw/extensions/voice-call/src/   (Openclaw AI Version 22©)  Datei vom 26.3.2026 mit Größe 1 kB image not shown  

Quelle  voice-mapping.test.ts

  Sprache: JAVA
 

import { describe, expect, it } from "vitest";
import {
  DEFAULT_POLLY_VOICE,
  escapeXml,
  getOpenAiVoiceNames,
  isOpenAiVoice,
  mapVoiceToPolly,
} from "./voice-mapping.js";

describe("voice mapping", () => {
  it("escapes xml-special characters", () => {
    expect(escapeXml(`5 < 6 & "quote" 'apostrophe' > 4`)).toBe(
      "5 < 6 & "quote" 'apostrophe' > 4",
    );
  });

  it("maps openai voices, passes through provider voices, and falls back to default", () => {
    expect(mapVoiceToPolly("alloy")).toBe("Polly.Joanna");
    expect(mapVoiceToPolly("ECHO")).toBe("Polly.Matthew");
    expect(mapVoiceToPolly("Polly.Brian")).toBe("Polly.Brian");
    expect(mapVoiceToPolly("Google.en-US-Standard-C")).toBe("Google.en-US-Standard-C");
    expect(mapVoiceToPolly("unknown")).toBe(DEFAULT_POLLY_VOICE);
    expect(mapVoiceToPolly(undefined)).toBe(DEFAULT_POLLY_VOICE);
  });

  it("detects known openai voices and lists them", () => {
    expect(isOpenAiVoice("nova")).toBe(true);
    expect(isOpenAiVoice("NOVA")).toBe(true);
    expect(isOpenAiVoice("Polly.Joanna")).toBe(false);
    expect(getOpenAiVoiceNames()).toEqual(
      expect.arrayContaining(["alloy""echo""fable""nova""onyx""shimmer"]),
    );
  });
});

Messung V0.5 in Prozent
C=93 H=95 G=93

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.