sararob / ml-talk-demos

Code for the demos from my Google Next '17 talk: https://youtu.be/w1xNTLH1zlA and I/O '17 talk: https://www.youtube.com/watch?v=ETeeSYMGZn0
Apache License 2.0
300 stars 126 forks source link

Problem with speech base64 encoding #4

Closed matthiasanderer closed 7 years ago

matthiasanderer commented 7 years ago

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