audio-play icon indicating copy to clipboard operation
audio-play copied to clipboard

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

Open thegoatherder opened this issue 3 years ago • 1 comments

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?

thegoatherder avatar Sep 18 '20 01:09 thegoatherder