Google sdk actions do not play audio in ssml from firebase storage

Actions The Google SDK cannot play audio files in the SSML Audio tag from firebase storage. Although I could play in .ogg format in wikipedia format. https://upload.wikimedia.org/wikipedia/en/9/9f/Sample_of_%22Another_Day_in_Paradise%22.ogg

firebase file : https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&token=d0d08f9d-e340-478c-af00-657109683136

I use it by sending an SSML string that looks like this:

<speak> <audio src='https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&token=d0d08f9d-e340-478c-af00-657109683136'> </audio> </speak> 

But I get the following error:

expected_inputs [0] .input_prompt.rich_initial_prompt.items [0] .simple_response: 'ssml' could not be parsed.

What could be the reason ... Is this a limitation in sdk's actions that the URL should be parameter free?

+5
source share
1 answer

The problem is not that it cannot use parameters - it is that when parsing parameters in URLs embedded in SSML, it does not parse or separate parameters, as these days parsers parse them.

There are several potential solutions for this, depending on how you can format the URL.

RFC 1866 used for recommendation of use; instead of &, and some servers allow this. Unfortunately, Firebase Storage is not one of them.

In most cases, Firebase Storage does not require a final marker parameter, so in this case you can omit it, but this is not a general solution to the problem.

Finally, you can use SGML encoding and replace both as &amp; (note the leading ampersand and the end semicolon). So your SSML will look something like this:

 <speak> <audio src='https://firebasestorage.googleapis.com/v0/b/assisto-skill.appspot.com/o/TIP103_converted.mp3?alt=media&amp;token=d0d08f9d-e340-478c-af00-657109683136'> </audio> </speak> 

This latter method is probably best suited for general purposes.

+5
source

Source: https://habr.com/ru/post/1268261/


All Articles