Skip to content

Italian (if_sara/im_nicola, lang_code='i') audio always truncated to fixed 0.3s regardless of input length #364

Description

@ZonatedCord

Bug description

Using lang_code='i' (Italian, espeak-ng fallback) with either Italian voice (if_sara or im_nicola), every synthesized clip is truncated to a fixed length of exactly 7200 samples (0.3s at 24kHz), regardless of input text length — from a single word up to full sentences of 100+ characters. Confirmed reproducible with kokoro 0.7.4, 0.7.9, and 0.7.16 (same result on all three), on macOS (Apple Silicon, M1).

This is not "long text runs fast" — the output sample count is identical across wildly different inputs, and each is missing most of the intended sentence.

Repro

from kokoro import KPipeline
pipeline = KPipeline(lang_code='i')

for text in [
    'Ciao.',
    'Ciao Marco come stai oggi',
    'Questa è una frase molto più lunga per vedere se la durata dell audio cambia in base alla lunghezza del testo che sto scrivendo qui adesso',
]:
    for _g, _p, audio in pipeline(text, voice='if_sara'):
        print(len(text), 'chars ->', len(audio), 'samples', round(len(audio) / 24000, 3), 'sec')

Output on my machine:

5 chars -> 7200 samples 0.3 sec
25 chars -> 7200 samples 0.3 sec
138 chars -> 7200 samples 0.3 sec

Same result whether text is a single string or pre-split into separate \n-joined sentences (each sentence chunk independently comes back as exactly 7200 samples).

What I ruled out

  • Not a G2P/vocab issue: phonemization via espeak-ng produces correct, full-length IPA (verified against espeak-ng --voices=it), and every phoneme in the string maps to a valid model.vocab entry (KModel.vocab.get(p) — checked manually, zero Nones, so nothing is silently filtered before reaching the model).
  • Not a permissions/environment issue: same exact 7200-sample result across 3 separate installs (fresh venvs), 3 different kokoro versions, with misaki at both its bundled version and 0.9.4 installed manually.
  • English works correctly — same machine, same pipeline pattern, lang_code='a', voice='af_heart': a comparable-length English sentence produces ~94800 samples (3.95s), scaling normally with text length.
  • Audio content is not silence — it's real (non-zero) waveform data, just cut off very early.

Environment

  • macOS, Apple Silicon (M1)
  • Python 3.12
  • kokoro 0.7.4 / 0.7.9 / 0.7.16 (all three tested, same result)
  • espeak-ng 1.52.0 (Homebrew), Italian voice pack present (espeak-ng --voices=it lists it)

Expected

Audio duration should scale with input text length for the Italian (espeak fallback) voices, similar to the native English/Japanese/Chinese pipelines.

Related but not identical: #301 (Spanish em_alex returns silence on Windows) — different symptom (empty vs. fixed-length truncation) and different platform, so filing separately rather than piling on there.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions