Skip to content

createPronunciationGuardrail

Create a guardrail that swaps terms for their spoken form before synthesis.

function createPronunciationGuardrail(options): Guardrail;

Defined in: src/guardrails/pronunciation.ts:118

Create a guardrail that swaps terms for their spoken form before synthesis.

Parameters

ParameterType
optionsPronunciationOptions

Returns

Guardrail

Remarks

Longer terms are matched first, so a dictionary containing both AWS and AWS Lambda applies the more specific entry. Each term then runs in turn over the result of the previous one, so a spoken form that happens to contain another (shorter) dictionary key will itself be rewritten — mapping { PostgreSQL: 'post gres SQL', SQL: 'sequel' } speaks “post gres sequel”. Spell replacements out phonetically to avoid the cascade.

Example

const agent = new CompositeVoice({
  providers: [...],
  guardrails: {
    filters: [
      createPronunciationGuardrail({
        replacements: {
          SQL: 'sequel',
          kubectl: 'kube control',
          PostgreSQL: 'post-gres-Q-L',
          'CI/CD': 'C I C D',
        },
      }),
    ],
  },
});

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency