0

I've created a bidirectional stream with assistant.converse(), and sending audio is successful.

const assistant = new protocol.EmbeddedAssistant(ASSISTANT_API_ENDPOINT, credentials);
const conversation = assistant.converse();
conversation.on('data', data => {
  console.log(data);
});

conversation.on('error', err => {
  console.log(err);
  micStream.end();
});
conversation.write({ config }); // audio type config
micStream // an object that provides an audio stream
  .pipe(through2.obj((chunk, enc, cb) => cb(null, { 'audio_in': chunk })))
  .pipe(conversation);

When I stop talking and Assistant detects silence, the Assistant throws this error:

{ Error: Failed to parse server response
    at ClientDuplexStream._emitStatusIfDone (/Users/arilotter/Projects/assistant/node_modules/grpc/src/node/src/client.js:201:19)
    at ClientDuplexStream._receiveStatus (/Users/arilotter/Projects/assistant/node_modules/grpc/src/node/src/client.js:180:8)
    at /Users/arilotter/Projects/assistant/node_modules/grpc/src/node/src/client.js:649:14 code: 13, metadata: undefined }
Ari Lotter
  • 605
  • 8
  • 23
  • 1
    This doesn't solve the problem, but "Failed to parse server response" is an error generated on the client when the response message doesn't match the expected format. – murgatroid99 May 12 '17 at 00:58
  • @murgatroid999 I can't under why the response message wouldn't match the expected format when the .proto file is provided by Google – Ari Lotter May 12 '17 at 13:07
  • can you show the content of the `config` and `conversation` objects? – proppy May 19 '17 at 05:00

0 Answers0