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
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
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 ?
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.
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.