Skip to content

TTS: phone numbers air as arithmetic — "555-0142" is spoken as "five hundred and fifty five … one hundred and forty two" #700

Description

@genwave-radio

What airs

Halvorsen spot, demo: "Five hundred and fifty five minus one hundred and forty two". Every spot with a number does it.

Why

  • Our normaliser has no digit handling: src/GenWave.Tts/SpeechText.cs:134-136 scopes number reading to spike: automated pronunciation lexicon generator for Tts:Corrections #211's lexicon; the flatten keeps 555-0142 intact (a hyphen between digits is intra-word under LooseMarkRx) and hands it to Kokoro raw. Kokoro's own log (2026-09-05 20:28:44Z) shows the post-normaliser text: "…file tax preparation five hundred and fift…".
  • kokoro-fastapi v0.6.0 normalizer.py: its phone regex needs the 10-digit shape; a 7-digit 555-0142 falls through to handle_numbers() (inflect number_to_words) with the hyphen rendered as a connector → cardinals.
  • Tts:Corrections cannot express this: rules are literal (Regex.Escape, F68.5). "How would we make one generic enough for any phone number?" — we can't; it is a normaliser rule.

Fix

A phone-shape pass in SpeechText.Normalize (pure, F68.6), before the flatten: reuse PhoneShapeCheck's regex (\(?\b\d{3}\)?[-.\s]\d{3}[-.\s]\d{4}\b|\b\d{3}[-.\s]\d{4}\b) → spoken digits with a comma per group: 555-0142 → "five five five, oh one four two" (single-digit words are read one by one by every engine). Applies to every speech kind, not only ads. Theory tests: 7-digit, 10-digit, dotted, parenthesised; a plain year or price untouched. Decide "oh" vs "zero" (radio says "oh"; proposing "oh").

Acceptance

Kokoro's "Generating audio for text" line for the CTA reads "five five five, oh one four two".

Epic: #380

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium prioritybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions