Play music with Spotify in Visual Studio Code
Visual Studio Code is a powerful code editor powered by a thriving ecosystem of extensions to supercharge your development environment. With a single click, you can add collaboration tools, source control visualizers, and code autocompletion.
You can even integrate Spotify right into Visual Studio Code.
To control your Spotify player from VS Code and begin playing your music right from your code editor, all you need is the Music Time extension. Music Time makes it easy to control your music, view your currently playing songs, and browse your Spotify playlists.
We’ll walk you through how to:
- Set up VS Code to integrate with Spotify
- Find and control your Spotify music
- Get instant access to song recommendations
- Generate personalized playlists
- See how your coding data stacks up to your music
Let’s get started.
Integrate Spotify with VS Code
Visit the Music Time information page, find your code editor or IDE from the selection dropdown, and click Install to visit the relevant plugin marketplace. Here you will find instructions to install the Music Time extension for VS Code.
Once the Music Time extension is installed in VS Code, you’ll need to connect your Spotify account to control your music from your code editor. To connect your code editor to Spotify, simply open the new Music Time view in the side panel and click Connect Spotify.
On Windows and Linux, you’ll need a premium Spotify subscription to control your music. If you are use macOS, Music Time can control the Spotify desktop app using AppleScript as either a premium or non-premium user.
Once you authorize Spotify, revisit VS Code to test out your new Spotify integration.
Browse and control your Spotify music
After signing in, you’ll notice a few new features enabled in your code editor.
First, in the Activity Bar you’ll see a new headphones icon. If you click on this icon, it will open the Side Bar, which will have two sections, My Playlists and Recommendations.
My Playlists gives you quick access to all of your Spotify playlists by automatically importing them right into VS Code. Clicking on a playlist will show you all of the songs in that playlist. Clicking on a song name will start playing that song. It’s that easy!
To play, pause, rewind, and skip music, find the player controls on the left side of your Status Bar. Your Status Bar will also show the currently playing song.
You can also quickly add a song to your Spotify Liked Songs playlist by clicking the small heart icon next to the music controls.
Get instant access to song recommendations
Music Time doesn’t just play music; it can also recommend songs and build custom playlists, just for you.
If you click on the headphones icon in the Activity Bar and open the Side Bar, you’ll see a section called Recommendations. Here you’ll find songs that we think you’ll enjoy listening to while you code based on your listening history.
You can even hover over the Recommendations label and hit the refresh icon to find new songs.
Not the right type of music? You can change the type of music that Music Time recommends to you. Next to the refresh button, click the filter icon to pick another genre or click the beaker icon to switch up energy, tempo, or valence.
Generate personalized playlists
For even better music recommendations, Music Time will automatically generate entire personalized Spotify playlists for you to listen to while coding in VS Code.
Revisit the My Playlists section in the Music Time Side Bar. Clicking on Generate My AI 40 will create a new playlist in Spotify that is similar to music that you listen to while you code best.
A new playlist should appear under My Playlists called “My AI Top 40.” Refresh this playlist at any time by clicking Refresh My AI 40.
More controls for Spotify power users
Music Time is an incredibly powerful extension for VS Code and Spotify. If you want to be a Spotify power user in VS Code, here are a few other controls:
- If you hover over the My Playlists label, you will see four icons. With these controls, you can toggle shuffle on or off, sort your playlists, refresh your music, or search for a song.
- If you hover over a song in the Music Time view, you will see a share button and an add button. If you click the share button, you can share a link to that song to Facebook, Twitter, Slack, or copy the Spotify song link. Clicking the add button will allow you to add the song to a playlist, or create a new playlist with that song.
- If you want to see what device Spotify is currently playing on, look for the Spotify icon under My Playlists. Music Time will let you specify what device you want to play your music on by clicking “Listening on…” and selecting a device.
See how your coding data stacks up to your music
What music did you listen to last week? What were your top songs?
In the Music Time panel, select Open Dashboard under My Playlists. This will generate a dashboard in VS Code showing your most productive songs, artists, and genres. You can even find global charts that show what other developers are listening to around the world with the Music Time integration.
Want even more data? Visit the web app by clicking See web analytics under My Playlists. From here, you’ll drop into your very own personal music profile on Software. You can browse your top songs, genres, and artists—as well as their productivity scores.
To dive deeper, click the Explore Metrics button in the web app. You’ll be able to see a breakdown of your music by key musical traits, such as energy, tempo, and valence.
Boost your productivity
With Music Time, you can easily integrate Spotify in VS Code to control your music right from your code editor. That should help you get in flow faster, avoid context switching, and be more productive!
Find the Music Time plugin in the VS Code marketplace and integrate Spotify in just a few minutes. With the right music, you’ll be in flow in no time.
Get the latest developer news delivered to your inbox every week
Subscribe to the Source newsletter to get the latest technology news and insights on new developer tools delivered to your inbox every week. It’s written for developers and the format is quick and digestible.