node-red-contrib-alexa-remote2 icon indicating copy to clipboard operation
node-red-contrib-alexa-remote2 copied to clipboard

SSML audio

Open mohesles opened this issue 6 years ago • 22 comments

Ive been able to use SSML correctly except for audio tags.

I have tried hosted <speak>HI<audio src="https://s3-us-west-1.amazonaws.com/sayspring-prod/media/celtic-open-chime.mp3" />Welcome</speak>

and amazon native sounds <speak>HI<audio src="soundbank://soundlibrary/transportation/amzn_sfx_car_accelerate_01" />Welcome</speak>

In both scenarios the audio tags are just ignored by alexa and the rest spoken normally.

mohesles avatar Apr 19 '19 00:04 mohesles

Thanks for the great node!

I also have no success with

thomas314159 avatar May 07 '19 14:05 thomas314159

Hello,

same problem here: the audio tag produces no sound, even with the Amazon sound bank. Is this a limitation from Amazon ?

eRudy avatar May 12 '19 16:05 eRudy

Don't know the reason but unfortunately audio tags don't seem to work at the moment.

586837r avatar Jun 03 '19 17:06 586837r

Don't know the reason but unfortunately audio tags don't seem to work at the moment.

Could it be that the code is escaping <><> tags?

mohesles avatar Jun 03 '19 20:06 mohesles

No, any other tags work it is some limitation from amazon.

586837r avatar Jun 03 '19 20:06 586837r

second this...this would be really cool to use it as a door bell for example...

martinschki avatar Jul 13 '19 13:07 martinschki

unfortunately it seems this is a limitation by amazon.. frustrating

zyrorl avatar Aug 28 '19 10:08 zyrorl

Wondering if anything has changed since August... just wasted an hour trying to do this.

zimmer62 avatar Dec 29 '19 20:12 zimmer62

Just tried it today, sending to a 3rd generation Echo Dot using an Amazon account without Prime, and it was only able to produce the text portions of the SSML phrase, not the audio tags.

tdejneka avatar Jan 25 '20 23:01 tdejneka

Same here, I realised SSML is the way to go but nothing works so far..

877dev avatar Mar 10 '20 09:03 877dev

@martinschki recent update supports doorbell :)

877dev avatar Apr 08 '20 12:04 877dev

@877dev: Did you use the "Sound"-command or the "Speak" - SSML with audio tag? I did not get to work the <audio src="soundbank://soundlibrary/transportation/amzn_sfx_car_accelerate_01" /> in speak - ssml. The sound command works for me too.

mfl76 avatar Apr 09 '20 17:04 mfl76

soundbank didn't work for me also, but I do see some sounds now like doorbell.

zimmer62 avatar May 13 '20 19:05 zimmer62

Amazon uses a subset of SSML. I use this as a guide:

SSML Tags Supported by Amazon Polly

SteveRMann avatar Sep 09 '20 15:09 SteveRMann

I found sort of a work around to play a beep whenever something happens in my system. Use the "expletive" tag. Try this...

.

kfishermail avatar Oct 08 '20 05:10 kfishermail

So I was working on this just last night and if you look at https://developer.amazon.com/en-US/docs/alexa/custom-skills/speech-synthesis-markup-language-ssml-reference.html#audio it provides some information about how the MP3 must be encoded in a specific way. In addition to that I used this to play an MP3 file as a "Speak at Volume - Regular" command:

<speak> <audio src="https://jhsfkl78345hkjd.s3-us-west-2.amazonaws.com/alarm1-alexa.mp3" /> </speak>

mholttech avatar Dec 31 '20 21:12 mholttech

On a similar topic, I also want to make the 'Red alert' sound which works if I explicitly define it, but I can't get it to work from a message. Any ideas of the correct message format? This is what I use, and it returns success, but no sound. {"topic":"Alexa Message","type": "sound","payload":{"sound": "Red alert","devices": ["Kitchen Echo Show"]}}

bbostock avatar Apr 15 '21 15:04 bbostock

Hey there, the solution from @mholttech works! The important thing is that the mp3 file is accessible from the internet via not self-signed https. Also you need to have a limit of 240 seconds, the bit rate must be 48kbps and the sample rate must be 22050Hz, 24000Hz, or 16000Hz. For more information to convert (even with audacity) see: 22050Hz, 24000Hz, or 16000Hz.

To trigger the mp3 sound from nodered use the "Alexa Routine" node. Use "Speak at Volume" with "Regular" option. For the text you can insert all mentioned here: eg:

<speak> Play sound <audio src="PublicUrlToMP3"/> </speak>

or only

<audio src="PublicUrlToMP3"/>

To access the mp3 publicly I use my public accessible nextcloud server and share the file, or you may use https://v3.jovo.tech/audio-converter but the file there are only available for 24 hours. You also may use GoogleDrive or Dropbox for that when share the file

MTrinkiesJr avatar Jan 12 '22 01:01 MTrinkiesJr

I'm getting Alexa to say this at least, tried a correct format mp3 via github, dropbox, jovo tech and other websites in case it was the htpps issue...

"Sorry, I'm having trouble accessing your Simon Says EU skill right now."

877dev avatar Jan 13 '22 14:01 877dev

Same problem as above "Sorry, I'm having trouble accessing your Simon Says EU skill right now."

fpovoski avatar Jul 18 '22 14:07 fpovoski

Confirm the comment from MTrinkiesJr work! The format of mp3 files must be correct and the public URL endpoint must provide an SSL certificate signed by an Amazon-approved certificate authority.

minhdirox avatar Jun 18 '23 02:06 minhdirox

This is an example that works for me:

<speak>
<audio src="soundbank://soundlibrary/musical/amzn_sfx_bell_timer_01"/>
<prosody rate="slow" volume="x-loud" pitch="-10%" intensity="medium">You have mail.</prosody>
</speak>


ronsegal avatar Oct 17 '23 19:10 ronsegal