Trouble using audio tag in IntentScript

Hi,
I’m having trouble using the SSML audio tag in an IntentScript for Alexa. When the speech gets to the point where the audio should play, I get an error saying there was a problem with the skill response.
My current IntentScript looks like this:

intent_script:
  TemperatureIntent:
    speech:
      type: ssml
      text: >
        <speak> 
        indoor temperature {{ states('sensor.aeotec_zw100_multisensor_6_temperature') }}.
        Indoor humidity {{ states('sensor.aeotec_zw100_multisensor_6_relative_humidity') }}.
        outside temperature {{ states("sensor.dark_sky_temperature") }}. 
        <audio src='https://www.beltanethebook.com/sad.mp3' /> 
        feels like {{ states("sensor.dark_sky_apparent_temperature") }}.
        outside humidity {{ states("sensor.dark_sky_humidity") }}.
        Wind {{ states("sensor.dark_sky_wind_bearing") }} at {{ states("sensor.dark_sky_wind_speed") }}.</speak>

I have tried using both single and double quotes in the audio tag, but nothing helps.
The audio plays if I put the URL in a browser and the file is in the correct format for Alexa.
Am I missing something here?
Thanks!

I haven’t seen any responses to this. Does anyone have any ideas?

I think you need to create 2 speak’s and the audio in the middle. I’m not sure alexa can understand audio inside speak.

        <speak> 
        indoor temperature {{ states('sensor.aeotec_zw100_multisensor_6_temperature') }}.
        Indoor humidity {{ states('sensor.aeotec_zw100_multisensor_6_relative_humidity') }}.
        outside temperature {{ states("sensor.dark_sky_temperature") }}.
        </speak>
        <audio src='https://www.beltanethebook.com/sad.mp3' /> 
        <speak> 
        feels like {{ states("sensor.dark_sky_apparent_temperature") }}.
        outside humidity {{ states("sensor.dark_sky_humidity") }}.
        Wind {{ states("sensor.dark_sky_wind_bearing") }} at {{ states("sensor.dark_sky_wind_speed") }}.
        </speak>

Granted, I’ve never used this functionality but I would assume that its object oriented xml and something like that wouldn’t typically fly.

Possibly, but it doesn’t look like it. On the Alexa SSML reference, they give this example:

<speak>
    Welcome to Car-Fu. 
    <audio src="https://s3.amazonaws.com/ask-soundlibrary/transportation/amzn_sfx_car_accelerate_01.mp3" /> 
    You can order a ride, or request a fare estimate. 
    Which will it be?
</speak> 

Ok, the first thing i notice is you are using single quotes and the example is using double quotes. Most xml does not support single quotes.

        <speak> 
        indoor temperature {{ states('sensor.aeotec_zw100_multisensor_6_temperature') }}.
        Indoor humidity {{ states('sensor.aeotec_zw100_multisensor_6_relative_humidity') }}.
        outside temperature {{ states('sensor.dark_sky_temperature') }}. 
        <audio src="https://www.beltanethebook.com/sad.mp3" /> 
        feels like {{ states('sensor.dark_sky_apparent_temperature') }}.
        outside humidity {{ states('sensor.dark_sky_humidity') }}.
        Wind {{ states('sensor.dark_sky_wind_bearing') }} at {{ states('sensor.dark_sky_wind_speed') }}.</speak>

EDIT: To clarify, i’m referring to <audio src=""/>.

Hi,
Thanks for your suggestions! Unfortunately, I have tried both single and double quotes with the same results.

so the error that you are getting with the skill response, is this alexa just saying that or is there an actual error being logged via home assistant or the like?

Also, have you tried using this intent inside amazon dev? From what i remember, you could add phrases to a test field and alexa would ‘respond with text’ on the screen. It’s been about a year since I touched it… so i could be remembering wrong.

Hi,
The error comes from Alexa saying “there was a problem with the requested skill’s response.”
I can’t see any error messages either in the dev console or in the HA logs.
Running the intent through the tester in the alexa console gives the same response.

There is a problem with the Intent Script.

I’ve tried the same without success. My bet is that’s not possible to use and

Yes, so if you use the test functionality in your dev utility on amazon’s dev website, you can see the response that Home assistant is sending to alexa. Then you can use that to fix it in home assistant to make it work.