Skip to content

🎧 A VS Code extension that auto-plays ambient music to help developers focus. Seamlessly rotates relaxing YouTube tracks while you code. No setup required.

License

Notifications You must be signed in to change notification settings

taj54/ambient-music-vs-extension

🎡 Ambient Music AutoPlayer for VS Code

Inspiration
One day, I realized I had been feeling unproductive for several days. After a quick self-reflection, I discovered that watching TV series and movies in the background while coding was draining my focus and creativity. This insight inspired me to build a tool for myselfβ€”and for thousands of other developers who face similar distractionsβ€”to help us stay in the zone with relaxing ambient music.


Badges

Version Installs Downloads License TypeScript


🎧 What It Does

Ambient music starts automatically with your project and seamlessly transitions to a new track every 30 minutes (by default) to keep you in the zone.


✨ Features

  • βœ… Automatically plays ambient music when a workspace is opened
  • βœ… Rotates to a new track every 30 minutes (configurable)
  • βœ… Prevents multiple instances with singleton design
  • βœ… Supports reconnecting WebSocket clients
  • βœ… Manual play/pause/resume via Command Palette
  • βœ… Easily set your own playlist via command
  • βœ… Manually close the tab via Ambient Music: ❌ Close Tab command
  • βœ… No configuration required for default usage

πŸš€ How to Use

Automatic Playback

  1. Install the extension from Marketplace
  2. Open any folder/project in VS Code
  3. A browser tab will auto-launch playing ambient music
  4. You'll receive a confirmation notification

Manual Controls

Open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and search for:

Command ID Title Description
ambientMusic.setPlaylist 🎢 Set Playlist (Rain, Forest, Ocean...) Choose or define a relaxing playlist
ambientMusic.openTab 🌐 Open Ambient Music Player Opens the embedded music player tab
ambientMusic.play ▢️ Play Ambient Music Starts playing ambient music
ambientMusic.pause ⏸️ Pause Music Pauses the currently playing track
ambientMusic.resume ⏯ Resume Music Resumes paused ambient music
ambientMusic.closeTab ❌ Close Music Player Closes the music player tab
ambientMusic.resetPlaylist πŸ”„ Reset Playlist to Default Restores the default ambient playlist

πŸ’‘ Tip: You can customize keybindings for these commands or use them in your automation workflows inside VS Code.


πŸ”§ Configuration (Optional)

These settings can be customized in your VS Code settings.json.

Setting Key Type Default Description
ambientMusic.autoPlayOnStartup boolean true Automatically start ambient music when VS Code launches.
ambientMusic.port number 3303 Port for the WebSocket server. Set to 0 for dynamic port allocation.
ambientMusic.switchIntervalMinutes number 30 Time interval (in minutes) to automatically switch to the next video in the playlist.
ambientMusic.debug boolean false Enables verbose debug logging for easier troubleshooting.
ambientMusic.playlist array [] Custom list of ambient YouTube videos with rich metadata. See example below.

🎡 Playlist Format Example

{
  "title": "Peaceful Piano",
  "url": "https://youtu.be/abc123",
  "tags": ["piano", "relax"],
  "channel": {
    "name": "Chill Music Co.",
    "url": "https://youtube.com/@chillmusicco"
  }
}

ℹ️ Use these to personalize your flow.


πŸ“ Installation

Install from Visual Studio Code Marketplace.

πŸ’‘ Want to close the music tab without shutting down the extension? Use the Ambient Music: ❌ Close Tab command.


πŸ”— Requirements

  • VS Code version 1.80+
  • Internet access for streaming

πŸ› Support

Have feedback or issues?


πŸ’Ό License

MIT License Β© 2025 Taj


πŸ’¬ Credits

Built with ❀️ by Taj, inspired by a need for focus and flow while coding.

Special thanks to these amazing YouTube creators whose music powers the ambient experience:

If you're one of these creators and would like your content removed or credited differently, please open an issue or reach out.

🧰 Developer Guide

If you're interested in contributing or modifying this extension, check out the DEVELOPER GUIDE for setup instructions, architecture overview, packaging guide, and testing tips.


✨ Focus better. Code deeper. Let your workspace sing.

About

🎧 A VS Code extension that auto-plays ambient music to help developers focus. Seamlessly rotates relaxing YouTube tracks while you code. No setup required.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •