Skip to content

[cloud speech] the right way to get a transcript from operation? base64 decode!? #2312

@mfkenson

Description

@mfkenson

screen shot 2017-05-16 at 9 58 40 pm

Though I couldn't find the usage of operation reference to get a transcript result.
I found something similar by base64-decoding operation.metadata.response.value..

The strange thing is I got some special characters after decoding the value.
Could you share the the right way to get a transcript from operation?

var operation = speechClient.operation('68850831366825');
operation.get({},function(err,res){
              if (err){
                  console.log(err);
                  return;
              }
              var metadata = res.metadata;
              var isDone = metadata.done;
              if (isDone && metadata.response) {
                  var b64string = metadata.response.value;
                  var buf = new Buffer(b64string, 'base64');
                  var transcript = buf.toString('utf8');
                  .....
             }

Metadata

Metadata

Assignees

Labels

api: speechIssues related to the Speech-to-Text API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions