This is one of my very first attempts (besides Purge time I made before)
I want to play an mp3 file until I ask Alexa to stop. This is was I have so far (The same code I used for the Purge one)
const Alexa = require('ask-sdk-core');
const Util = require('./util.js');
const LaunchRequestHandler = {
canHandle(handlerInput) {
return Alexa.getRequestType(handlerInput.requestEnvelope) === 'LaunchRequest';
},
handle(handlerInput) {
const audioUrl = Util.getS3PreSignedUrl("Media/white_noise_500_hz_formatted.mp3").replace(/&/g,'&');
return handlerInput.responseBuilder
.speak(`<audio src="${audioUrl}"/>`)
.getResponse();
}
};
exports.handler = Alexa.SkillBuilders.custom().addRequestHandlers(LaunchRequestHandler).lambda();
As a complete noob, I'm a bit lost. I'd need to wait to put the MP3 in a queue before it finishes or something.
Any idea is welcome, thanks!
PS. I know there are skills for white noise and rain sounds and so on, this one if for learning purposes :D
question from:
https://stackoverflow.com/questions/65910485/loop-a-mp3-file-in-an-alexa-skill 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…