question

namphho avatar image
namphho asked

How to get "streamUrl" in Reponse

Hi everybody, Do you have any tutorial step by step or android example to get "streamUrl" from "Speechrecognizer Responses". I think I must configure some parameters in "Speechrecognizer Request" for streaming data but I don't know how to set it. I don't have any experience for streaming data. Any help much appreciated, thanks Message was edited by: namphho
alexa voice service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Eric@Amazon avatar image
Eric@Amazon answered
Hi namphho, You should take a look at the sample app, here: https://developer.amazon.com/edw/res/download/AlexaVoiceServiceExamples.zip In the AVSController.java file, pay attention to handleResponse and handleMedia. When a play directive is returned from Alexa, handleResponse hands off the response to handleMedia, which parses the streamUrl and plays the file. There's nothing special you have to enable to get the stream url, no parameters you need to set. -Eric
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

namphho avatar image
namphho answered
Thank @Eric for response quickly, I found API document about Directive Object in "speechrecognizer-responses". there is a "name" key with values ( clear, listen, play, speak, stop). As handleResponse in AVSController.java, it get streamUrl when "name" key is "play". So I have 2 question for you. 1. when "name":"play" is attached in "speechrecognizer-responses" ? (at now, I always receive "name":"speak" ) 2. what is "clear, listen, play, speak, stop" used for ?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Eric@Amazon avatar image
Eric@Amazon answered
The name of the directive is 'play' when AVS is telling you to play some audio. If the user asks to play a song, or for their flash briefing, or to play a radio station, you'll get a play directive. clearQueue: Sometimes play items will queue up, and you're intended to play them in order. This directive says to get rid of any items that you haven't yet played because the user doesn't want to listen anymore listen: Sometimes Alexa needs to have a conversation with the user. If the user says something, but Alexa needs more information, it will respond with a question and then provide a "listen" directive. This tells you that you should automatically begin listening again to allow the user to respond to Alexa's question play: play the stream that Alexa provides speak: Alexa wants to speak to the user. stop: stop all speech/media that's playing.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

rahulzkuma avatar image
rahulzkuma answered
Hello Team, I am trying to use the iOS sample app and facing an issue. It seems like some "CA.DER" is missing in the sample code. Kindly have a look to the problem. Thanks
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

elstryan@Amazon avatar image
elstryan@Amazon answered
The ca.der file is generated as part of the generate.sh script that we include and ask developers to run as part of https://developer.amazon.com/public/solutions/alexa/alexa-voice-service/docs/reference-implementation-guide#Generating%20Self-Signed%20Certificates. At the end of this script we copy the ca.der file to the iOS project under the Resources directory. Please make sure that when this command was run no errors were output to the console and if there were errors please comment so we can debug the issues you're facing. Then at the end of this script we copy the ca.der to the parent directory via "cp certs/ca/ca.der ../iOSCompanionApp/Resources/App/" so if any of the sub folders under the samples directory have moved this will not work and you'll have to copy over the ca.der file directly.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.