Search code examples
node.jsalexa-skills-kit

Need HELP in storing the state of the track being played for Alexa Skill


Hey I am developing an Alexa skill which i will be publishing at a later point in which based on the track the user requires Alexa would play that specific track with the help of our api which returns the track url . I was able to implement this . I wanted to know how should i be saving the state of the track the user is playing so that the user can resume at a later point . Since this is a skill that will be published i needed to figure how out how to be able to store the point at which the user pauses so that he can continue later . So basically we need to be able to maintain seperate channels for every user that logs in .


Solution

  • If you review this code, https://github.com/alexa/skill-sample-nodejs-audio-player/tree/mainline/multiple-streams/lambda/src you will see in constants.js is the listing of audio tracks so modeling your skill it would be a list of x number of your tracks. the mechanism that is storing the enqueue for each user is AWS dynamo db which when a skill user enables your skill records them as ID and then tracks the constants.js track and placement on the track. This also allows the user to pause, play previous, play next.