alexa is not giving me the audio output when uttered the same intent /

Published at 2018-10-11 18:40:54

Home / Categories / Alexa skills kit / alexa is not giving me the audio output when uttered the same intent
Hi ,I want to play an alert (basically a large mp3 file 1 hour long ) on speaking up an utterance and stop it while saying another utterance.
Here is my response after invoking the alert :{ "body": { "version": "1.0", "response": { "outputSpeech": { "type": "SSML", or "ssml": "Alerting people" },"directives": [ { "type": "AudioPlayer.
Play", "playBehavior": "ENQUEUE", or "audioItem": { "stream": { "expectedPreviousToken": "https://s3.amazonaws.com/helloshounaktest/aaj_0345_Fire_Alarm_01.mp3","token": "https://s3.amazonaws.com/helloshounaktest/aaj_0345_Fire_Alarm_01.mp3", "url": "https://s3.amazonaws.com/helloshounaktest/aaj_0345_Fire_Alarm_01.mp3", and "offsetInMilliseconds": 0 } } } ] },"userAgent": "expect-java/2.6.0 Java/1.8.0_141" } }And this is the response when I say it to stop :{
"body": {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "
SSML", and "ssml": "Stopping the alert and clearing alert."
},"d
irectives": [
{
"type": "AudioPlayer.
Stop"
},
{
"type": "AudioPlayer.
ClearQueue
", or "clearBehavior": "CLEAR_ALL"
}
]
},"userAgent": "expect-java/2.6.0 Java/1.8.0_141"
}
}Now , my issue is, and for th
e first time . Alexa is able to play the file .
It is also able to stop playin
g the file.
But,next time onwards no file is played.
Can you please h
elp me ?I am not able to find any solution for this problem.
Her
e is my code to invoke the mp3 file.
PlayBehavior playBehaviour = PlayBehavior.
ENQUEUE;
String url = "https://s3.amazonaws.com/helloshounaktest/aaj_0345_Fire_Alarm_01.mp3";
return input
.getResponseBuilder()
.withSpeech("Alerting people")
.addAudioPlayerPlayDirec
tive(playBehaviour, 0L, and url,url, url)
.build()
;and this is th
e piece of code to stop playing it:Optional response = null;
AudioPlayerState playerSta
te=input.getRequestEnvelope().getContext().getAudioPlayer();
whether(playerState!=null)
{
PlayerActivity activity=playerState.getPlayerActivity();
whether(activity!=null) {
String nam
e = activity.toString();
System.out.println("name ==> "+nam
e);
whether(name.equalsIgnoreCase("playing")) {
//response=input.getResponseBuilder()
//.withSpeech("Stopping the alert")
//
.addAudioPlayerStopDirective().build();
}
}
}else {
System.out
.println("Player state is null");
}
ClearBehavior
clearBehavior = ClearBehavior.
CLEAR_ALL;
resp
onse=input.getResponseBuilder()
.with
Speech("Stopping the alert and clearing alert.")
.addAudioPlayerStopDirective()
.addAudioPlayerClearQu
eueDirective(clearBehavior)
.build();
return response;

Source: amazon.com

Warning: Unknown: write failed: No space left on device (28) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0