diff --git a/README.md b/README.md index cd99d31..4efbc70 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ Install ask-cli and initialize it ``` $ npm install -g ask-cli -$ ask-cli init ``` Install awscli -Configure us-east-1 region +Configure us-east-1 region (region is hardcoded in scripts and easier when using the Alexa Skill) +```aws configure``` Create Lambda function, DynamoDB table and iam roles ``` @@ -15,17 +15,27 @@ $ aws cloudformation deploy --template-file ./infrastructure/music-cloud.json -- $ aws cloudformation describe-stacks --stack-name music-cloud-stack ``` -Edit .ask/config.template with your skill id and Lambda ARN (aws cloudformation describe-stacks) +Create Alexa Skill, as detailed in https://medium.com/voice-tech-podcast/build-your-own-music-streaming-service-with-amazon-alexa-41c7bf1eb66a. Some of the options have changed, make sure to use lowercase just select Custom when asked for Model. + +Edit .ask/config.template with your skill ID (provided after creating the Alexa Skill) and Lambda ARN (aws cloudformation describe-stacks) and save as .ask/config + +In AWS Lambda, add a Alexa Skills Kit trigger for the MusicCloudLambda function, inputting the skill ID. + +Now that the skill ID is known, initialize 'ask': +```ask-cli init``` +Input the skill ID, and for Package Path: +./lambda/us-east-1_MusicCloudLambda/ + +Copy the Lambda’s ARN (from the upper right corner: ARN — arn:aws:lambda:us-east-1:*:function:MusicCloudLambda) and go back to your Alexa Skill -> Build -> Endpoint and paste it into the Default Region field. Save. Build Model to have changes take effect. -Add Alexa Skills Kit trigger for the MusicCloudLambda To generate the catalog files: -Install and configure awscli +Generate Dropbox token as described here: https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/ -Create user, roles and DynamoDB table, Drobpbox token as described here: https://medium.com/@andreiciobanu_15529/build-your-own-music-streaming-service-with-amazon-alexa-41c7bf1eb66a +Edit dropbox-catalog/.env.template with your Dropbox token and save as .env -Edit .env.template with your Dropbox token and rename to .env +Make sure your music folder contains _only_ .mp3 files ``` $ cd dropbox-catalog $ npm install @@ -33,7 +43,13 @@ $ node index.js upload -d ./mp3/ $ node index.js catalog ``` -Upload catalog files as described in the medium article +The first command, for each MP3 file from the ./mp3/ directory it will: +- read the ID3 tags — please make sure each file has at least the artist and the title +- upload the file to Dropbox +- create a shareable link +- save the ID3 tags and the shareable link to the cloud-music table + +The second command will create two files: artists.json and songs.json. These two files represent the catalogs which will be uploaded to Alexa and make it understand your music collection. Deploy the skill and lambda ```