Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextToSpeech Stream (StreamingSynthesizeRequest) Documentation #5707

Closed
6 tasks done
brunocarneiro opened this issue Sep 24, 2024 · 2 comments
Closed
6 tasks done

TextToSpeech Stream (StreamingSynthesizeRequest) Documentation #5707

brunocarneiro opened this issue Sep 24, 2024 · 2 comments

Comments

@brunocarneiro
Copy link

Please make sure you have searched for information in the following guides.

Documentation Request

Hello,

I'm trying to use the new method ttsClient.streamingSynthesize but unsuccessfully. The error I'm getting is:
"Malordered Data Received. Expected streaming_config but received input. Send exactly one config, followed by text input"

After checking the documentation, the PR and the unit test of the version "@google-cloud/text-to-speech": "5.4.0" I couldn't find any example of the StreamingSynthesizeRequest populated. Also could not find any tts stream sample here.

Here is part of my code:

            const request = {
                streamingConfig: { voice: { languageCode: 'es-es', name: 'es-ES-Polyglot-1' } },
                input: { text: '¡hola!' }
              };
            
            const stream = await client.streamingSynthesize();
            stream.on('data', (response) => this.onData(response));
            stream.on('error', (err) => reject(err));
            stream.on('end', () => resolve());
            stream.write(request);
            stream.end();
@sofisl
Copy link
Contributor

sofisl commented Sep 24, 2024

Hi @brunocarneiro,

Thanks for your question. Since these libraries are mostly autogenerated, this documentation request is not something we can fulfill (it needs to be done either by the API, or it needs a handwritten sample).

  • If this is a question, please submit your question to text-to-speech here). You can also submit it as a question to our Discussions tab to engage our community.
  • If this is a request for handwritten documentation, please submit it to googleapis/nodejs-docs-samples.
  • Although this isn't quite the same, there is an example for streaming with text-to-speech that seems fairly similar

@sofisl sofisl closed this as completed Sep 24, 2024
@utrolig
Copy link

utrolig commented Nov 19, 2024

Like @brunocarneiro mentioned, the example does not work and gives the following error:

Malordered Data Received. Expected streaming_config but received input. Send exactly one config, followed by text input

I've tried writing a streaming_config config first before writing the request object, but it's still the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants