Skip to content

Huge difference between output of original PocketTTS and Kotlin API #3172

Closed

Description

@WaelShaikh

I have noticed that there is a huge difference in the generated TTS audio output of the original Python implementation by Kyutai and the sherpa-onnx Kotlin API (I've only tested the Kotlin API so far so I can't speak about the others).

Input Reference Audio:

https://huggingface.co/kyutai/tts-voices/blob/main/vctk/p250_023.wav

Audio generated by local Kyutai inference in orignal python implementation:

kyutai-python-tts-audio.wav

Audio generated by sherpa-onnx Kotlin API:

generated_tts_1770827709946.wav


Are there any hyperparameters that I may be missing or could utilize to improve inference quality? Increasing numSteps to 100 still doesn't help.

Inference Code:

                val genConfig = GenerationConfig()
                genConfig.referenceAudio = wave.samples
                genConfig.referenceSampleRate = wave.sampleRate
                genConfig.numSteps = 5
                genConfig.extra = mapOf(
                    "temperature" to "0.7",
                    "chunk_size" to "15",
                )

                tts.generateWithConfigAndCallback(
                    text,
                    genConfig,
                    ::ttsCallback
                )

Activity

  1. dosubot commented on Feb 11, 2026

    @dosubot

    Hi @WaelShaikh! I'm Dosu and I’m helping the sherpa-onnx team.

    The sherpa-onnx documentation for the Kotlin API doesn't list all available hyperparameters for Kyutai TTS, but based on related TTS models, parameters like speaker ID (sid), length scale (vits-length-scale), and rule-based text normalization (tts-rule-fsts) can impact output quality, in addition to numSteps, temperature, and chunk_size that you're already using. These parameters are commonly exposed in CLI and Python APIs, but it's unclear if they're available in the Kotlin API without checking the source code or API docs.

    To improve quality, try increasing numSteps, adjusting temperature, and experimenting with chunk_size. If your model or API supports it, try setting sid (for speaker selection), vits-length-scale (for speech speed/prosody), or enabling rule-based normalization for numbers and dates. The lack of Kyutai-specific tuning guidance in the docs means some trial and error may be needed, and reviewing the Kotlin API source or comparing with the original Python implementation could reveal more tunable options.

    Reference: sherpa-onnx TTS model parameters

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about sherpa-onnx with Dosu Add Dosu to your team

  2. WaelShaikh commented on Feb 11, 2026

    @WaelShaikh
    Author

    Update:

    I was using the int8 version of the model. Using the full precision model does significantly improve quality even at 1 inference step. Also increasing chunk size to 50 also helps.

    Closing this.

  3. ramlakk commented on Feb 14, 2026

    @ramlakk

    @WaelShaikh Can You Share The Configs? Wav File Attributes Like What Kind Of Audio Is Used?

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions