Skip to content

Commit 70dfa1b

Browse files
Render custom councils 5% slower
A multi-voice custom debate is denser than a single-figure mode, more voices, more interruption, more arguments to follow. The slower pace gives the listener room. Applied at the TTS request layer so the gateway adjusts speed via ffmpeg atempo and pitch stays correct; Web Audio playbackRate would have shifted pitch about one semitone.
1 parent 77c45ee commit 70dfa1b

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

client/src/services/council/CustomCouncilService.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ import { getAudioContext } from '../audio/audioQueueManager';
1919
import { splitForGatewayCap } from '../audio/utils/splitForGatewayCap';
2020
import { sendConversion, COUNCIL_ENGAGED_THRESHOLD_S } from '../../utils/public/gclidCapture';
2121

22+
// Custom councils render 5% slower than the user's general TTS speed. The
23+
// debate is denser than a single-figure mode (more voices, more interruption,
24+
// more arguments to follow), so the slower pace gives the listener room.
25+
// Applied at the TTS request layer so the gateway adjusts speed correctly
26+
// (ffmpeg atempo preserves pitch); doing it via Web Audio playbackRate would
27+
// shift pitch ~1 semitone.
28+
const COUNCIL_SPEED_MULTIPLIER = 0.95;
29+
2230
// ============================================
2331
// Type Definitions
2432
// ============================================
@@ -1033,11 +1041,12 @@ export class CustomCouncilService {
10331041

10341042
// Per-chunk filename suffix prevents server-side cache collisions when
10351043
// the same segment-id maps to multiple TTS calls.
1044+
const councilSpeed = ttsSettings.speed * COUNCIL_SPEED_MULTIPLIER;
10361045
const renderChunk = (chunkText: string, idx: number): Promise<AudioFile> => {
10371046
const chunkBaseName = chunks.length > 1 ? `${sessionPrefixedId}_c${idx + 1}` : sessionPrefixedId;
10381047
return explicitVoice
1039-
? this._generateTTSWithExplicitVoice(chunkText, chunkBaseName, explicitVoice, ttsService, ttsSettings.speed, language, sessionId)
1040-
: convertTextToSpeech(chunkText, chunkBaseName, speakerId, ttsService, ttsSettings.speed, language, sessionId);
1048+
? this._generateTTSWithExplicitVoice(chunkText, chunkBaseName, explicitVoice, ttsService, councilSpeed, language, sessionId)
1049+
: convertTextToSpeech(chunkText, chunkBaseName, speakerId, ttsService, councilSpeed, language, sessionId);
10411050
};
10421051

10431052
// Parallel render for multi-chunk segments — same speaker means same

0 commit comments

Comments
 (0)