# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
lexstream
Alexa Music skill for streaming your own music.
Documentation links
Various documentation links that have been useful when building out this project
Prerequisites
- Go
- Node.js
- Alexa Skills Kit requires
node --version
v8.3 or higher.
- Alexa Skills Kit requires
- AWS Account
- Configuration and credential file settings
- These credentials need to have permissions to change S3, IAM, DynamoDB, and Lambda resources
- AWS CLI
- Alexa Developer Console
- Validate that you can sign in
Initialize Go Modules
- Use
go mod tidy
in the root of this repository to initialize dependencies
Run preflight check
go run cmd/preflight.go
will:- Check that the minimum version of node is installed.
- Configure and test ask-cli in the .ask directory.
- This will prompt to run
ask configure
if no credentials are found
- This will prompt to run
- Check that AWS credentials and configuration files are set up correctly.
- This performs read only api calls for S3, IAM, DynamoDB, and Lambda
- Check that the aws cli command is installed
Warning commands after this point start modifying things, so read warnings closely
Generate Login with Amazon Keys
- Create a new security profile for your Amazon Developer account by following the instructions provided here
- This will generate
Client ID
andClient Secret
keys. - Save these keys in the file
secret.json
in this format{ "client_id": "amzn1.application-oa2-client.xxxxx", "client_secret": "xxxxxx" }
- Run
go run smapi/lwa/main.go
- this automates a call toask util generate-lwa-tokens
- This must be run on a computer with a browser to handle the LWA oauth flow
- The resulting token will be saved to token.json and updated when it expires.
Create settings.json
- Copy settings.json.example to settings.json and update with the appropriate content
{
"bucket": "<unique bucket name>",
"lambda_name": "lexstream_lambda",
"skill_name": "<skill name>"
}
Deploy Skill
- Run
go run infra/skill/create.go
to create the skill. - TODO: instructions for creating catalog, uploading, and associating with skill
Create S3 bucket and Deploy Lambda
WARNING if the provided bucket already exists the permissions will be re-set to no public access
- Run the following command to create the required Bucket, IAM Role, and Lambda
# requires golang mage to be installed $ mage -v
Update Endpoint and Re-Validate
TODO: this should be able to be automated
- Back in the Alexa skills console, update the skill endpoint with the output of the previous command
Design Notes
- Use MusicBrainz_API for identifiers wherever possible.
- Completed
- Artist,Album, and Track are all directly supported and would be unique
- Prefix each since the MB Api uses GUIDs that are opaque
TODOs and other ramblings
-
Right now this just plays a single song on loop
-
Create a web interface / cli to upload new songs
- upload audio files and cover art to s3
- extract metadata from id tags in audio and create catalog files
- automate upload of catalog data
Theask cli
does a browser login to get the access token so this may not be possible- more research
- This is possible using LWA tokens and calling the upload catalog api directly
- Add documentation on how this works
-
Metadata notes showing id -> api mappings
- MUSICBRAINZ_ARTISTID
- MUSICBRAINZ_ALBUMARTISTID
- MUSICBRAINZ_TRACKID
- MUSICBRAINZ_ALBUMID
- This ID can be used on the cover art archive
- Redirects to the internet archive
- MUSICBRAINZ_RELEASEGROUPID
- MUSICBRAINZ_WORKID
- MUSICBRAINZ_RELEASETRACKID=a022f133-009d-3e9f-b0c1-d2e30e86e98e
- I don't think this one can be directly queried, but it shows up under /media/tracks/id in MUSICBRAINZ_ALBUMID
- It can also be used as an anchor for the release page
-
Saving whipper command
whipper cd rip -p
Initial readme created by tigwen