Want to Play YouTube Music on Alexa? this article will help you out. Many companies these days launching their smart speakers. But, no doubt Amazon Echo and Google Home smart speakers are best among all. Google Home comes with Google Assistant, and Amazon Echo comes with Alexa. Both smart speakers are capable to do similar tasks. Like, controlling smart devices through voice commands. And, Smart speakers do replies to all your queries. Well, If you’re using the Amazon Echo device, then you might already be aware of what it can do.
The Amazon Echo smart speakers come with a large selection of music streaming services. You can play music from Amazon Music, Spotify, JioSaavn, Apple Music, iHeartRadio, TuneIn, Pandora, VEVO, TIDAL, Deezer and many other services. By going into Amazon Alexa App’s Settings > Music, you can link a new service. But, Alexa lacks an important service, which is YouTube Music.
Alexa and YouTube Music.
A lot of people including me like to listen to music on YouTube. Rather than going into Apps and services specifically designed for music. Because YouTube is free and has millions of tracks and playlists. There are some songs, that you won’t find out on streaming services frequently, that available for free on YouTube music.
Google and Amazon are still in dispute over the sale of Google Home devices on Amazon. And, YouTube (Owned by Google) is a competitor to Amazon Music. That’s why Echo devices officially do not support YouTube Music. Well, still there are certain ways to Play YouTube Music on Alexa. That you will get to know through this article.
Play YouTube Music on Alexa.
Method 1: Play via Bluetooth.
Amazon Echo comes with the ability to play music from other sources via Bluetooth Connection. You just need to pair your Echo with external devices using Bluetooth. Any Bluetooth-enabled device with an internet connection will work. Like, smartphone, iPad (tablet), laptop (PC).
1. Turn on Bluetooth on your Smartphone or another device that you want to connect.
2. Now, Say ‘Alexa, Connect with my phone”. Alexa will now start searching for Bluetooth enabled device. Follow the instructions appear on the screen, to pair the Echo with your device.
1. If it doesn’t work, due to any reason. Then, Open Amazon Alexa App, tap on Devices > Echo & Alexa > Echo Dot.
2. In Echo dot settings, tap on Bluetooth devices. Now, tap on “Pair a new device”.
3. Your smartphone name will appear in the list. Tap on it, and then tap on pair.
That’s it, now anything that you will play on your device. Sound will come from Amazon Echo. So basically, you’re casting your device audio to Alexa. You can now Play YouTube music on Alexa.
And, can stop the playback, and turn the volume up and down from your smartphone.
Method: 2 Add a Skill to Alexa.
You might be unsatisfied with the first method. Because it will turn your smart speaker into Bluetooth speaker. Well, Amazon is not gonna add direct support for YouTube playback anytime soon in the future. But, with Alexa-youtube (Unofficial YouTube skill for Alexa), you can.
If you’re not aware, the Alexa skills are like Apps. You can enable or disable skills from App or from a Web browser. Like similarly you install/uninstall Apps in your smartphone. More specifically skills are voice-driven Alexa capabilities. Well, adding the YouTube skill to Alexa isn’t that easy. But, going through the process is really worth it. Because you will able to playing YouTube Music on Alexa through voice commands.
Get an API Key from Google.
1. First, Visit the Google API Console. And, Click on “Create Project”.
In the project name, enter “YouTube” and then click on Create. Within a few seconds, a new project will get created.
2. Click on the Google APIs logo from the upper left corner. After that, click on “Enable APIS AND SERVICES”.
And, look for “YouTube Data API v3”. Click on it from search results and then click on Enable.
Click on “CREATE CREDENTIALS”.
3. In which API you’re using, select “YouTube Data API v3”. And, in where you be calling the API form, select “Web server (e.g. node.js, Tomcat) Now, select “Public Data”, and, click on “What Credentials do I need”.
That’s it, you got an API Key. Copy it and save it somewhere safe in notepad.
Amazon Web Service (AWS).
1. Open Amazon Web Services site, and complete signup process. (Debit/Credit card information is required. Don’t worry, it will not charge anything. Just Select Free Plan.)
2. Open AWS Management Console from My Account. First, select your locale. (Check option before support in the upper right corner.)
After that, In the “find services” section, search for “Lambda” and click on it.
3. Click on “Create Function”. Now, make sure ‘Author from scratch’ is selected. In Function name, type “YouTube”. And, in runtime, select “Python 2.7”. Click on “Create Function”. (Also make sure, in “Choose or create an execution role” the “Create a new role….” radio button is selected.)
Creating function It will take a while, be patient.
4. On the next screen, click on “Add a trigger”. In trigger configuration, select “Alexa Skills Set” as a trigger. Select “disable” in Alexa ID verification. Click on “Add”.
Now, Go to the Youtube-for-Alexa GitHub page and download the Lambda.zip file.
5. Go back to the Lambda Management Console tab, Click on ‘YouTube’.
In the function code section, Select “Upload a .zip file” in the code entry type section. Click on upload and select the Lambda.zip file that you downloaded. And, click on Open.
6. Scroll a little bit further and set the memory to 512MB and timeout to 10 seconds. (You have to click on edit, you can find this option in the basic settings section.)
7. You will see the environment variable option on the same page. Click on the Edit environment variable. We are going to add two variables.
Click on ‘Add environment variable, and in key type DEVELOPER_KEY. And in value paste the API key, which you got from Google API Console.
Again click on ‘Add environment variable’ and this time in key type youtube_dl and in value type true. Click on save.
8. After adding zip file and entering variables. Click on save. It will upload the zip file.
9. Scroll to the very top of the screen, you will see an ARN. Copy this ARN in Notepad.
Create a Skill to Play YouTube Music on Alexa.
1. Open the Alexa developer console site, and sign in using your Amazon account. (Make sure the same account logged in Amazon Echo.)
2. Click on “create skill”. Enter You Tube in skill name. Make sure “Custom” and “Provision your own” is selected. Click on “Create skill”.
The template selection page will appear. Select “Start from scratch” and click on choose.
3. Go to the Interfaces tab from the left pane. And, enable these three options. Audio Player, Display Interface and Video App. Click on “save interfaces”.
4. Again from the left pane, click on JSON Editor. You will see some code in the JSON editor. Select all code and delete it.
Open this YouTube for the Alexa InteractionModel_en code page and copy all code. (Press Ctrl + A and then Ctrl + C)
5. Go back to Alexa Developer Console, and paste the code in JSON Editor.
After that, click on the save model, then click on the build model. (Build will get started and will take a while.)
6. From Left Pane, click on Endpoint. Select the AWS Lambda ARN radio button. And, paste the ARN code in default region, that you got from AWS. Click on “Save Endpoints”.
7. Final Step, Go to Test tab. In Test is disabled for skill. Select “Development”. This option will enable the skill on your Amazon Echo device. So, now you can play YouTube music in your Amazon Echo Device.
Skill Commands. (Example)
- For Video – “Alexa, ask YouTube to play Despacito”
- For Playlist – “Alexa, ask YouTube to play playlist Ultimate Beyonce”
- To Play a Channel – “Alexa, ask YouTube to play channel Fall Out Boy Vevo”
You can ask for the timestamp. Next / Previous / Start Over / Pause / Resume commands will also work. Feel Free to Comment. If you face any issue during setting up Alexa-YouTube skill.