sararob/ml-talk-demos

Problem with speech base64 encoding

Closed this issue · 0 comments

When using the script (speech/request.sh) as in the repository I get an error response related to base64 encoding:

"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "audio.content",
"description": "Invalid value at 'audio.content' (TYPE_BYTES), Base64 decoding failed for "ZkxhQwAAACIQ [.... long base 64 string]

SOLUTION:

What did work for me was to append a ' -w 0' flag to the base64 command:
Line47 should then be: echo "base64 audio.flac -w 0" > audio.base64