Commit 9368acc
Use Kokoro v1 models and fix audio trimming via pred_dur
Switches to v1 models on all platforms to avoid source_noise issues in v2.
Fixes audio endpoint trimming by computing length from pred_dur output.
Changes:
- ModelNames.swift: Use v1 models (.mlmodelc) on all platforms instead of v2 (_v2.mlmodelc)
- KokoroSynthesizer.swift: Compute audio length from pred_dur (frames * 600) instead of broken audio_length_samples
Results:
- "Hello world" → 1.5s (was 5s)
- "This is a test of kokoro" → 2.35s (was 5s)
- Proper trimming without cutting off speech
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 06fc2ab commit 9368acc
File tree
2 files changed
+14
-23
lines changed- Sources/FluidAudio
- TTS/Kokoro/Pipeline/Synthesize
2 files changed
+14
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | | - | |
| 538 | + | |
540 | 539 | | |
541 | 540 | | |
542 | 541 | | |
543 | 542 | | |
544 | 543 | | |
545 | 544 | | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | 545 | | |
556 | 546 | | |
557 | 547 | | |
| |||
Lines changed: 13 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
424 | 423 | | |
425 | | - | |
426 | | - | |
427 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
428 | 429 | | |
429 | 430 | | |
430 | 431 | | |
| |||
0 commit comments