Skip to content

Commit 442f2c3

Browse files
steipeteql-wade
andcommitted
fix: honor explicit OpenAI TTS speed values
Landed from contributor PR #39318 by @ql-wade. Co-authored-by: ql-wade <[email protected]>
1 parent 28b72e5 commit 442f2c3

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Docs: https://docs.openclaw.ai
7171
- TUI/session isolation for `/new`: make `/new` allocate a unique `tui-<uuid>` session key instead of resetting the shared agent session, so multiple TUI clients on the same agent stop receiving each other’s replies; also sanitize `/new` and `/reset` failure text before rendering in-terminal. Landed from contributor PR #39238 by @widingmarcus-cyber. Thanks @widingmarcus-cyber.
7272
- Synology Chat/rate-limit env parsing: honor `SYNOLOGY_RATE_LIMIT=0` as an explicit value while still falling back to the default limit for malformed env values instead of partially parsing them. Landed from contributor PR #39197 by @scoootscooob. Thanks @scoootscooob.
7373
- Voice-call/OpenAI Realtime STT config defaults: honor explicit `vadThreshold: 0` and `silenceDurationMs: 0` instead of silently replacing them with defaults. Landed from contributor PR #39196 by @scoootscooob. Thanks @scoootscooob.
74+
- Voice-call/OpenAI TTS speed config: honor explicit `speed: 0` instead of silently replacing it with the default speed. Landed from contributor PR #39318 by @ql-wade. Thanks @ql-wade.
7475
- Cron/file permission hardening: enforce owner-only (`0600`) cron store/backup/run-log files and harden cron store + run-log directories to `0700`, including pre-existing directories from older installs. (#36078) Thanks @aerelune.
7576
- Gateway/remote WS break-glass hostname support: honor `OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1` for `ws://` hostname URLs (not only private IP literals) across onboarding validation and runtime gateway connection checks, while still rejecting public IP literals and non-unicast IPv6 endpoints. (#36930) Thanks @manju-rn.
7677
- Routing/binding lookup scalability: pre-index route bindings by channel/account and avoid full binding-list rescans on channel-account cache rollover, preventing multi-second `resolveAgentRoute` stalls in large binding configurations. (#36915) Thanks @songchenghao.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { describe, expect, it } from "vitest";
2+
import type { OpenAITTSConfig } from "./tts-openai.js";
3+
import { OpenAITTSProvider } from "./tts-openai.js";
4+
5+
type ProviderInternals = OpenAITTSProvider & {
6+
speed: number;
7+
};
8+
9+
function createProvider(config: OpenAITTSConfig): ProviderInternals {
10+
return new OpenAITTSProvider(config) as ProviderInternals;
11+
}
12+
13+
describe("OpenAITTSProvider constructor defaults", () => {
14+
it("uses speed: 0 when explicitly configured", () => {
15+
const provider = createProvider({
16+
apiKey: "sk-test",
17+
speed: 0,
18+
});
19+
20+
expect(provider.speed).toBe(0);
21+
});
22+
23+
it("falls back to speed default when undefined", () => {
24+
const provider = createProvider({
25+
apiKey: "sk-test",
26+
});
27+
28+
expect(provider.speed).toBe(1.0);
29+
});
30+
});

extensions/voice-call/src/providers/tts-openai.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export class OpenAITTSProvider {
8282
this.model = config.model || "gpt-4o-mini-tts";
8383
// Default to coral - good balance of quality and natural tone
8484
this.voice = (config.voice as OpenAITTSVoice) || "coral";
85-
this.speed = config.speed || 1.0;
85+
this.speed = config.speed ?? 1.0;
8686
this.instructions = config.instructions;
8787

8888
if (!this.apiKey) {

0 commit comments

Comments
 (0)