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

Can't play audio buffer returned from @google-cloud/text-to-speech #28

Open
thegoatherder opened this issue Sep 18, 2020 · 1 comment
Open

Comments

@thegoatherder
Copy link

Google Cloud Text to Speech returns a response.audioContent which logs to console as:

<Buffer ff f3 44 c4 00 12 6a d5 44 01 41 10 01 c6 37 00 20 8c 6c 80 04 05 fe 84 6a 9c ef f3 9f 39 f2 10 9f e4 24 8d bf fc e7 79 cf 21 09 c9 53 9e 42 49 53 ba ... 4846 more bytes>

Running this:

let playback = play(response.audioContent);
playback.play();

Errors out with:

Error: Argument should be an audio buffer

Am I doing something wrong?

@dy
Copy link
Member

dy commented Sep 18, 2020

Try converting Buffer to AudioBuffer via https://github.com/audiojs/audio-buffer-from

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

2 participants