{"id":27629294,"url":"https://github.com/jaries23/sounddeviceswitcher","last_synced_at":"2026-02-16T09:32:09.398Z","repository":{"id":286086812,"uuid":"960299233","full_name":"jaries23/SoundDeviceSwitcher","owner":"jaries23","description":"This batch script toggles between two predefined audio devices (e.g., earphones and speakers) using NirCmd and PowerShell. It checks if both devices are connected, determines the current default playback device, and switches to the other device accordingly. A notification balloon informs the user of the change or connection issue.","archived":false,"fork":false,"pushed_at":"2025-04-06T07:44:37.000Z","size":1406,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T15:16:13.067Z","etag":null,"topics":["batchfile","nircmd","powershell"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaries23.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-04T07:37:42.000Z","updated_at":"2025-04-06T07:44:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ae56ce8-1bda-4513-9b51-001ac25bf570","html_url":"https://github.com/jaries23/SoundDeviceSwitcher","commit_stats":null,"previous_names":["jaries23/defaultsystemdevicetoggle"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jaries23/SoundDeviceSwitcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaries23%2FSoundDeviceSwitcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaries23%2FSoundDeviceSwitcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaries23%2FSoundDeviceSwitcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaries23%2FSoundDeviceSwitcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaries23","download_url":"https://codeload.github.com/jaries23/SoundDeviceSwitcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaries23%2FSoundDeviceSwitcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270946068,"owners_count":24672890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batchfile","nircmd","powershell"],"created_at":"2025-04-23T15:16:06.681Z","updated_at":"2026-02-16T09:32:09.355Z","avatar_url":"https://github.com/jaries23.png","language":"Batchfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎧 SoundDeviceSwitcher\n\n\u003e 🔽 English instructions are available below.\n\nWindows에서 두 개의 오디오 장치(예: 이어폰과 스피커)를 **스마트하게 전환**할 수 있는 배치 스크립트입니다.\n\n단순한 토글이 아닌, 다음과 같은 **지능적인 기능**을 제공합니다:\n\n- ✅ **두 장치가 모두 연결된 경우에만 전환 실행**\n- 🔁 현재 기본 장치를 확인한 뒤 **다른 장치로 자동 전환**\n- 🔊 **기본 재생 장치**와 **기본 통신 장치**를 동시에 설정\n- 🔔 전환 후 트레이 알림으로 상태 표시\n- ⚡ Stream Deck, AutoHotKey 등 **단축키 도구와 연동** 용이\n\n\u003e 💡 장치가 하나라도 연결되어 있지 않으면, 스크립트는 전환을 취소하고 경고 메시지를 표시합니다.\n\n---\n\n## ✅ 사용 방법 (Korean)\n\n### 1. 파일 다운로드\n- GitHub에서 **초록색 Code 버튼** 클릭  \n- **Download ZIP** 선택  \n- 압축 파일을 해제한 후, 폴더에 다음 파일들이 있는지 확인:\n  - `device.bat`\n  - `device.vbs`\n  - `Install_Modules.ps1`\n\n### 2. PowerShell 모듈 설치 (최초 1회만)\n\n#### ✅ 자동 설치 방법\n- `Install_Modules.bat` 파일을 **마우스 오른쪽 클릭 → 관리자 권한으로 실행**  \n- 아래 작업이 자동으로 실행됩니다:\n  - ✅ 실행 정책을 `RemoteSigned`로 설정  \n  - 🎧 `AudioDeviceCmdlets` 모듈 설치 (이미 설치된 경우 생략)  \n  - 🔔 `BurntToast` 모듈 설치 (이미 설치된 경우 생략)\n- 설치가 완료되면 다음과 같은 메시지가 표시됩니다:\n  ```\n  🎉 모든 준비 완료! 이제 배치 스크립트에서 오디오 전환과 알림을 사용할 수 있습니다.\n  👋 설치가 완료되었습니다! 창을 닫으려면 Enter 키를 누르세요\n  ```\n- \u003e ⏳ **설치 후 창이 자동으로 닫히지 않으니, Enter 키를 눌러 수동으로 닫아주세요.**\n\n#### 🛠 수동 설치 방법\n`Install_Modules.bat` 를 통해 모듈을 설치할 수 없는 경우, 아래 명령어를 PowerShell에 직접 복사해서 붙여넣어 실행하세요:\n\n```powershell\n# 실행 정책을 RemoteSigned로 변경\nSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force\n\n# AudioDeviceCmdlets 설치\nInstall-Module -Name AudioDeviceCmdlets -Scope CurrentUser -Force\n\n# BurntToast 설치\nInstall-Module -Name BurntToast -Scope CurrentUser -Force\n```\n\n\u003e ⚠️ 모듈 설치 중 'NuGet 제공자' 관련 메시지가 나올 경우, `Y`를 입력하고 Enter 키를 눌러 진행하세요.\n\n---\n\n### 3. NirCmd 다운로드\n- 공식 사이트: [https://www.nirsoft.net/utils/nircmd.html](https://www.nirsoft.net/utils/nircmd.html)  \n- 페이지 하단에서 **“NirCmd 64-bit”** 다운로드  \n- 압축 해제 경로: `C:\\Program Files\\nircmd-x64`  \n- 해당 폴더 안에 `nircmd.exe` 파일이 있는지 확인\n\n### 4. 시스템 환경 변수 등록\n- 시작 메뉴에서 **“시스템 환경 변수 편집”** 검색 후 실행  \n- **\"환경 변수(N)...\"** 클릭  \n- **시스템 변수**에서 `Path` 선택 → **\"편집(I)...\"** 클릭  \n- **\"새로 만들기(N)\"** 클릭 → `C:\\Program Files\\nircmd-x64` 입력  \n- 모든 창을 **\"확인\"**으로 닫기\n\n### 5. 오디오 장치 이름 설정\n- `device.bat` 파일의 확장자를 `.txt`로 변경하여 메모장에서 열기  \n- `[설정]` 아래에 `earphone`, `speaker` 항목을 본인의 장치 이름으로 수정  \n- 저장 후 확장자를 `.bat`로 다시 변경\n\n### 6. 스크립트 실행\n- 폴더 안의 `device.vbs` 파일을 더블 클릭  \n- 실행창 없이 조용히 오디오 장치가 전환됨  \n- **Stream Deck**, **AutoHotKey** 등에서 이 `device.vbs` 파일을 실행하도록 연결하면 더 편리하게 사용 가능\n\n---\n\n## ✅ How to Use (English)\n\n**SoundDeviceSwitcher** is a batch script for **smartly toggling** between two audio devices on Windows (e.g., headphones and speakers).\n\nIt’s more than just a toggle—this script includes intelligent features:\n\n- ✅ **Only switches if both devices are connected**\n- 🔁 Automatically detects the current default device and switches to the other\n- 🔊 Sets both the **Default Playback Device** and **Default Communication Device**\n- 🔔 Displays a tray notification after switching\n- ⚡ Easily integrates with hotkey tools like Stream Deck or AutoHotKey\n\n\u003e 💡 If either device is not connected, the script will cancel the operation and show a warning instead of switching.\n\n---\n\n### 1. Download Files\n- Click the **green Code button** on GitHub  \n- Select **Download ZIP**  \n- Extract the ZIP file and make sure the folder contains:\n  - `device.bat`\n  - `device.vbs`\n  - `Install_Modules.ps1`\n\n### 2. Install PowerShell Modules (one-time setup)\n\n#### ✅ Automatic Method\n- Right-click `Install_Modules.bat` and select **Run as Administrator**  \n- The following will be performed automatically:\n  - ✅ Set execution policy to `RemoteSigned`  \n  - 🎧 Install `AudioDeviceCmdlets` module (skipped if already installed)  \n  - 🔔 Install `BurntToast` module (skipped if already installed)\n\n#### 🛠 Manual Method\nIf you can't run the script, copy and paste the following into PowerShell manually:\n\n```powershell\nSet-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force\nInstall-Module -Name AudioDeviceCmdlets -Scope CurrentUser -Force\nInstall-Module -Name BurntToast -Scope CurrentUser -Force\n```\n\n\u003e ⚠️ If prompted to install NuGet provider, type `Y` and press Enter.\n\n---\n\n### 3. Download NirCmd\n- Official site: [https://www.nirsoft.net/utils/nircmd.html](https://www.nirsoft.net/utils/nircmd.html)  \n- Scroll to the bottom and download **“NirCmd 64-bit”**  \n- Extract to: `C:\\Program Files\\nircmd-x64`  \n- Ensure `nircmd.exe` is present in that folder\n\n### 4. Add to System Environment Variables\n- Open the Start menu and search for **“Edit the system environment variables”**  \n- Click **“Environment Variables...”**  \n- In the **System variables** section, select `Path` → click **“Edit...”**  \n- Click **“New”** → add `C:\\Program Files\\nircmd-x64`  \n- Click **OK** to close all windows\n\n### 5. Set Your Audio Device Names\n- Rename `device.bat` to `.txt` and open it in Notepad  \n- Under the **[Settings]** section, change the `earphone` and `speaker` entries to match your actual device names  \n- Save and rename the file extension back to `.bat`\n\n### 6. Run the Script\n- Double-click the `device.vbs` file in the folder  \n- It will switch audio devices silently without opening any command windows  \n- You can link the `device.vbs` file to tools like **Stream Deck** or **AutoHotKey** for quick access\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaries23%2Fsounddeviceswitcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaries23%2Fsounddeviceswitcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaries23%2Fsounddeviceswitcher/lists"}