{"id":24886728,"url":"https://github.com/elenaches/batch--audio-device-switcher","last_synced_at":"2025-07-10T10:34:29.322Z","repository":{"id":220132074,"uuid":"744704740","full_name":"ElenaChes/Batch--Audio-Device-switcher","owner":"ElenaChes","description":"An audio device switcher written in Batch and Cscript using SoundVolumeView, a collection of scripts that can set the default audio device, check what is the current default audio device, or switch between 2 devices.","archived":false,"fork":false,"pushed_at":"2024-02-06T14:07:32.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T15:16:03.150Z","etag":null,"topics":["audio-device","batch","batch-script","cscript","script","soundvolumeview"],"latest_commit_sha":null,"homepage":"","language":"Batchfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElenaChes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-01-17T20:53:18.000Z","updated_at":"2024-01-17T20:58:48.000Z","dependencies_parsed_at":"2024-02-05T13:29:36.945Z","dependency_job_id":"3157fff4-22ff-4540-a432-4ef83b7d0b29","html_url":"https://github.com/ElenaChes/Batch--Audio-Device-switcher","commit_stats":null,"previous_names":["elenaches/batch--audio-device-switcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElenaChes%2FBatch--Audio-Device-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElenaChes%2FBatch--Audio-Device-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElenaChes%2FBatch--Audio-Device-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElenaChes%2FBatch--Audio-Device-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElenaChes","download_url":"https://codeload.github.com/ElenaChes/Batch--Audio-Device-switcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245825650,"owners_count":20678628,"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","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":["audio-device","batch","batch-script","cscript","script","soundvolumeview"],"created_at":"2025-02-01T15:16:06.814Z","updated_at":"2025-03-27T10:27:30.866Z","avatar_url":"https://github.com/ElenaChes.png","language":"Batchfile","readme":"# Audio Device switcher\n\nAn audio device switcher written in Batch and Cscript using [SoundVolumeView](https://www.nirsoft.net/utils/sound_volume_view.html).\u003cbr\u003e\nDescription: a collection of scripts that can set the default audio device, check what is the current default audio device, or switch between 2 devices.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch3\u003eContent\u003c/h3\u003e\u003c/summary\u003e\n\n- [Dependencies](#dependencies)\n- [Installation](#installation)\n- [Scripts](#scripts)\n  - [CheckDevice.bat](#checkdevicebat)\n  - [SwitchDevice.bat](#switchdevicebat)\n  - [PromptSwitch.bat](#promptswitchbat)\n  - [SwitchHeadset.bat](#switchheadsetbat)\n  - [SwitchSpeakers.bat](#switchspeakersbat)\n- [Usage](#usage)\n\n\u003c/details\u003e\n\u003chr\u003e\n\n# Dependencies\n\n1. SoundVolumeCommandLine v1.25 by Nir Sofer - [Website](https://www.nirsoft.net/utils/sound_volume_command_line.html).\n\nThe scripts could work with different versions, but that is the ones that was tested.\n\n# Installation\n\n1. Download and unpack the dependency.\n2. Download the desired scripts and `variables.csv`. The scripts are intentionally separate from each other, so you can download only the ones that you're going to use.\n\n\u003e [!TIP]\n\u003e Place the files in the same folder as `svcl.exe` for ease of use.\n\n3. Update `variables.csv` file so it fits your needs:\n\n```\nSoundVolumeView,\u003crelative path to svcl.exe\u003e\nTIMEOUT,\u003chow many seconds information popups wait before automatically closing\u003e\nCOLUMN,\u003cname of the column in SoundVolumeView that indicates your default device\u003e\nDEFAULT,\u003ckeyword that appears in COLUMN for your default device\u003e\nS_DEVICE,\u003cname of 1st audio device\u003e\nH_DEVICE,\u003cname of 2nd audio device\u003e\nS_VOLUME,\u003cdefault volume for 1st device\u003e\nH_VOLUME,\u003cdefault volume for 2nd device\u003e\n```\n\n\u003e [!NOTE]\n\u003e Notice that the variables are currently set to switch between a Headset and Speakers, so the comments in the code and file names reflect that, but you could use these scripts to switch between any 2 devices.\n\n# Scripts\n\n## CheckDevice.bat\n\nChecks which audio device (out of 2 options) is currently set as default and displays the information in a popup. If the current default device isn't one of the options an error message will be displayed.\n\n### Required variables:\n\n- SoundVolumeView, TIMEOUT, COLUMN, DEFAULT, H_DEVICE, S_DEVICE\n\n### Script behaviour:\n\n1. Reads variables from `VARS_PATH` (relative path to `variables.csv`, declared inside the script)\n2. Uses `SoundVolumeView` to get the value of `COLUMN` for `S_DEVICE` and `H_DEVICE`.\n3. Finds which device's state is set to the `DEFAULT` keyword.\n4. Displays info popup for `TIMEOUT` seconds.\n\n## SwitchDevice.bat\n\nChecks which audio device (out of 2 options) is currently set as default, sets the other device to default and displays the information in a popup. If the current default device isn't one of the options an error message will be displayed.\n\n### Required variables:\n\n- SoundVolumeView, TIMEOUT, COLUMN, DEFAULT, H_DEVICE, S_DEVICE, H_VOLUME, S_VOLUME\n\n### Script behaviour:\n\n1. Reads variables from `VARS_PATH` (relative path to `variables.csv`, declared inside the script)\n2. Uses `SoundVolumeView` to get the value of `COLUMN` for `S_DEVICE` and `H_DEVICE`.\n3. Finds which device's state is set to the `DEFAULT` keyword.\n4. Uses `SoundVolumeView` to switch default device to the other device.\n5. Uses `SoundVolumeView` to set default volume to the other device's default volume.\n6. Displays info popup for `TIMEOUT` seconds.\n\n## PromptSwitch.bat\n\nChecks which audio device (out of 2 options) is currently set as default, displays the information in a popup and asks user if should switch devices. If user selects \"ok\" in the prompt, sets the other device to default and displays the information in a popup. If the current default device isn't one of the options an error message will be displayed.\n\n### Required variables:\n\n- SoundVolumeView, TIMEOUT, COLUMN, DEFAULT, H_DEVICE, S_DEVICE, H_VOLUME, S_VOLUME\n\n### Script behaviour:\n\n1. Reads variables from `VARS_PATH` (relative path to `variables.csv`, declared inside the script)\n2. Uses `SoundVolumeView` to get the value of `COLUMN` for `S_DEVICE` and `H_DEVICE`.\n3. Finds which device's state is set to the `DEFAULT` keyword.\n4. Displays prompt popup.\n5. If selected \"ok\":\n   - Uses `SoundVolumeView` to switch default device to the other device.\n   - Uses `SoundVolumeView` to set default volume to the other device's default volume.\n   - Displays info popup for `TIMEOUT` seconds.\n6. If selected \"cancel\":\n   - Exits.\n\n## SwitchHeadset.bat\n\nSets `H_DEVICE` audio device to default regardless of the current default device and displays the information in a popup.\n\n### Required variables:\n\n- SoundVolumeView, TIMEOUT, H_DEVICE, H_VOLUME\n\n### Script behaviour:\n\n1. Reads variables from `VARS_PATH` (relative path to `variables.csv`, declared inside the script)\n2. Uses `SoundVolumeView` to switch default device to `H_DEVICE`.\n3. Uses `SoundVolumeView` to set default volume to `H_VOLUME`.\n4. Displays info popup for `TIMEOUT` seconds.\n\n## SwitchSpeakers.bat\n\nSets `S_DEVICE` audio device to default regardless of the current default device and displays the information in a popup.\n\n### Required variables:\n\n- SoundVolumeView, TIMEOUT, S_DEVICE, S_VOLUME\n\n### Script behaviour:\n\n1. Reads variables from `VARS_PATH` (relative path to `variables.csv`, declared inside the script)\n2. Uses `SoundVolumeView` to switch default device to `S_DEVICE`.\n3. Uses `SoundVolumeView` to set default volume to `S_VOLUME`.\n4. Displays info popup for `TIMEOUT` seconds.\n\n# Usage\n\n1. Run the desired script to switch/check your default audio device .\n\n\u003e [!TIP]\n\u003e Create a shortcut to a script on your desktop, open its properties and change `Run` to `Minimized`, that'll enable it to run in the background and only display the end result. Run the script via the shortcut instead of running the file directly.\n\n\u003e [!TIP]\n\u003e If your keyboard or mouse has programmable buttons you can set some to run your shortcut(s) to switch/check audio device without needing to go to your desktop.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felenaches%2Fbatch--audio-device-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felenaches%2Fbatch--audio-device-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felenaches%2Fbatch--audio-device-switcher/lists"}