Q:

Audio Payload Dialogflow (api.ai)

I'm making an action for the Google Assistant. I do have a javascript fullfilment but it's not really a good clear code it works so it's fine. By example, I don't know how to call an intent in js. But on to my question: is it possible to use the custom payload response for audio files? I know you can play audio files with the webhook but it would be lovely if it just possible in de custom payload. 
I want my welcome intent to have an audio response. If it's not possible how do I call the welcome intent in js?  
My webhook now: 

A:

It depends what you mean by the "custom payload" and exactly how long the audio you want to play is, but there are a number of ways you can play audio that you have configured from the Dialogflow settings. You can also play it from PHP using similar methods in some cases.
Playing short audio
Your speech responses can include SSML markup which can include an <audio> tag that includes audio. This audio must be under 120 seconds long. So you can have something like this:
<speak>Welcome to my action! <audio src="https://actions.google.com/sounds/v1/alarms/bugle_tune.ogg"></audio> How can I help you?</speak>

either in the Response Default tab or if you add a Simple Response in the Google Assistant tab. In the Default tab, it looks something like this:

If you're making a response for the Google Assistant only, you can do it in that tab by clicking on the "Google Assistant" tab and then "Add Responses"

You can then select a "Simple Response" to add and enter the SSML.

Playing longer audio
If your audio is longer than 120 seconds, you can add a Media Response to the Google Assistant response. You need to have a Simple Response already set and then click "Add Responses" to add another.

You may need to scroll down to select "Media Content".

Then add the information for the content. You need to provide, at a minimum, a name that will be displayed on screen-based devices and the URL for the audio.

