I am developing an alexa app for events to show. I am showing three events at the same time and if there is an artist associated with the event, alexa will ask user to say play if user wants to hear music. My issue is if I am keeping the session alive, alexa will ask the question and if user say nothing, it turns off and if I close the session, alexa asks the question and shut down.
Here is the sample code:
foreach($events as $key=>$event){
$eventname = "abcd";
$artistId = '1';
$artistName= "xyz";
$speech =$eventname;
$response = '{
"version" : "1.0",
"sessionAttributes": {
"artistId": "'.$artistId.'",
"artistName": "'.$artistName.'"
},
"response" : {
"outputSpeech" : {
"type" : "PlainText",
"text" : "'.$speech.'"
},
"shouldEndSession" : false
}
}';
echo $response;
}
You can refer to <break time=\"0.6s\"/>
Refer to this link Using break in SSML
<speak>
There is a three second pause here <break time="3s"/>
then the speech continues.
</speak>