Google Actions sdk not playing audio in ssml from firebase storage

前端 未结 1 1361
小蘑菇
小蘑菇 2021-01-13 07:45

Google Actions SDK is unable to play audio files in SSML Audio tag from firebase storage. Although I could play same .ogg format file from wikipedia. https://upload.wikimed

相关标签:
1条回答
  • 2021-01-13 08:39

    The problem isn't that it can't use parameters - it is that when parsing parameters in URLs that are embedded in SSML it doesn't parse the & separating the parameters the way most HTML parsers parse them these days.

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

    RFC 1866 used to recommend using a ; in place of an &, and some servers allow this. Unfortunately, Firebase Storage is not one of them.

    Firebase Storage doesn't require the final token parameter in most cases, so in this case you could omit it, but that isn't a general solution to the problem.

    Finally, you could use SGML encoding and replace the & as & (note the leading ampersand and final semicolon). So your SSML would look something like:

    <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 last method is probably the best for general purposes.

    0 讨论(0)
提交回复
热议问题