Nodejs-dialogflow: outputAudio is missing in response body

Created on 14 Sep 2018  路  4Comments  路  Source: googleapis/nodejs-dialogflow

OS: WIndows 10
Node.js version: 10.6.0
npm version: 6.4.1
dialogflow: REST API v2

I am trying to receive a text to speech response from dialogflow version 2 using only a text input but the outputAudioConfig is missing in the result. I already set the text to speech to true in settings and use below body which is working with text response only.

  session: "1234567",
  queryInput: {
    text: {
      text: query,
      languageCode: "en-US"
    }
  },
  outputAudioConfig: {
    audioEncoding: "OUTPUT_AUDIO_ENCODING_LINEAR_16",
  }

Kindly need assistance.

Thanks!

question needs more info dialogflow

All 4 comments

@YrockInnovators check that you are using the beta version:
const dialogflow = require('dialogflow').v2beta1;

@YrockInnovators did using the latest version fix your issue?

I am not using dialogflow libraries in my app module. I am accessing the dialogflow endpoint

private baseURL: string = "https://dialogflow.googleapis.com/v2/projects/'projectID'/agent/sessions/'sessionID':detectIntent";

return this.http
.post(${this.baseURL}, data, {headers: this.getHeaders(auth)})
.map(res => {
return res.json()
})

I did try to change the url to baseURL: string = "https://dialogflow.googleapis.com/v2beta1/projects/'projectID'/agent/sessions/'sessionID':detectIntent" and it is now displaying the outputAudio

thanks!

Was this page helpful?
0 / 5 - 0 ratings