Skip to content

MAI-Voice-2 fails on long SAPI text with input_too_long #114

Description

@frostboolio

i! First of all, thank you for NaturalVoiceSAPIAdapter. I managed to get it working with World of Warcraft's built-in Text-to-Speech system, and the result is amazing.

I am using Azure Speech voices through NaturalVoiceSAPIAdapter. Regular voices such as ru-RU-DmitryNeural work with long quest/dialogue text, but the new ru-RU-Lev:MAI-Voice-2 voice fails when the NPC dialogue is relatively long.

Lev works perfectly with short text, including inside World of Warcraft. However, with longer quest text there is no speech at all.

The NaturalVoiceSAPIAdapter log shows:

Cloud voice (Rest API) created: ru-RU-Lev:MAI-Voice-2
Rest API: Connection closed before all data could be received.
Speak: Payload rejected by server:
StatusCode="FailedPrecondition"
Detail="Bad MAI Request: {"error":{"code":"input_too_long", ...

The same error occurs consistently every time the long dialogue is sent.

Would it be possible for NaturalVoiceSAPIAdapter to automatically split long SAPI text into several smaller requests for MAI-Voice-2 voices, preferably at sentence boundaries, and then stream/play the resulting audio as one continuous SAPI utterance?

For example:

Long SAPI Speak request

split into sentence-based chunks

MAI request #1
MAI request #2
MAI request #3

continuous output back to the SAPI application

I understand that preserving SAPI events and signalling the end of the utterance correctly may make this more complicated than simply splitting the text.

If there is already another way to handle long text with MAI-Voice-2 in NaturalVoiceSAPIAdapter, I would be very grateful if you could point me in the right direction.

My main use case is World of Warcraft quest/dialogue narration. The quality of ru-RU-Lev:MAI-Voice-2 is fantastic for this, so it would be great to make it work with longer NPC dialogue as well.

Thank you again for your work on this project!

log.txt

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