{"id":17552464,"url":"https://github.com/mdonoughe/sbz-switch","last_synced_at":"2025-04-06T03:06:04.063Z","repository":{"id":26413843,"uuid":"108795652","full_name":"mdonoughe/sbz-switch","owner":"mdonoughe","description":"Utility for switching Sound Blaster outputs on Windows","archived":false,"fork":false,"pushed_at":"2024-10-19T02:10:08.000Z","size":231,"stargazers_count":45,"open_issues_count":9,"forks_count":7,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-30T02:04:21.114Z","etag":null,"topics":["cli","sound","sound-blaster","windows"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdonoughe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE.txt","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}},"created_at":"2017-10-30T03:08:27.000Z","updated_at":"2025-02-23T09:01:53.000Z","dependencies_parsed_at":"2025-02-12T20:11:45.391Z","dependency_job_id":"283e4233-d093-4bf5-bbe5-fd575d30fa81","html_url":"https://github.com/mdonoughe/sbz-switch","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdonoughe%2Fsbz-switch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdonoughe%2Fsbz-switch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdonoughe%2Fsbz-switch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdonoughe%2Fsbz-switch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdonoughe","download_url":"https://codeload.github.com/mdonoughe/sbz-switch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427005,"owners_count":20937200,"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":["cli","sound","sound-blaster","windows"],"created_at":"2024-10-21T05:04:38.535Z","updated_at":"2025-04-06T03:06:04.049Z","avatar_url":"https://github.com/mdonoughe.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbz-switch\n\n\u003e Utility for switching Sound Blaster outputs on Windows\n\n[![Crates.io](https://img.shields.io/crates/v/sbz-switch.svg)](https://crates.io/crates/sbz-switch) ![License](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg) [![Build Status](https://github.com/mdonoughe/sbz-switch/actions/workflows/build.yml/badge.svg)](https://github.com/mdonoughe/sbz-switch/actions/workflows/build.yml) [![Docs.rs](https://docs.rs/sbz-switch/badge.svg)](https://docs.rs/sbz-switch)\n\nThe Sound Blaster drivers, at least for the Sound Blaster Z, expose the speaker and headphone outputs as a single audio device to Windows, meaning the normal Windows methods of switching the sound output device will not work. Creative provides a graphical utility for this, but does it does not support hotkeys or anything like that, and it does not maintain a separate volume level for headphones vs speakers.\n\nThis is a simple utility that does the following:\n\n1. Mute the sound output.\n\n2. Change the Sound Blaster configuration.\n\n3. Optionally adjust the volume.\n\n4. Unmute.\n\nIt's designed to be easily triggered by a hotkey or something.\n\nThis may have bugs. Use at your own risk, especially if you have configured your headphones/speakers in a way that they could be damaged by maximum volume sound output during the switch.\n\n## Usage\n\n```\nUSAGE:\n    sbz-switch.exe [SUBCOMMAND]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nSUBCOMMANDS:\n    apply           Applies a saved configuration\n    dump            Prints out the current configuration\n    help            Prints this message or the help of the given subcommand(s)\n    list-devices    Prints out the names and IDs of available devices\n    set             Sets specific parameters\n    watch           Watches for events\n```\n\n### List Devices\n\n\u003e Find devices to control\n\n```\nUSAGE:\n    sbz-switch.exe list-devices\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -f \u003cFORMAT\u003e        Select the output format [default: toml]  [possible values: toml, json, yaml]\n```\n\nIf the Sound Blaster is not the default audio output, execute `list-devices` to get the device ID.\n\n```toml\n[[]]\nid = '{0.0.0.00000000}.{cba07706-3492-4789-bb31-0717e228bd14}'\ninterface = 'Sound Blaster Z'\ndescription = 'Speakers'\n\n[[]]\nid = '{0.0.0.00000000}.{baeaa072-e026-44e1-942e-c466170d9d6f}'\ninterface = 'Steam Streaming Microphone'\ndescription = 'Speakers'\n\n[[]]\nid = '{0.0.0.00000000}.{57e7b4bc-c860-4987-aed3-3ee8dd3617b9}'\ninterface = 'Steam Streaming Speakers'\ndescription = 'Speakers'\n\n[[]]\nid = '{0.0.0.00000000}.{128e193d-e35f-40dd-b414-16105e5ec32d}'\ninterface = '2- USB Audio Device'\ndescription = 'Speakers'\n```\n\nPass the device ID to other commands: `dump -d \"{0.0.0.00000000}.{cba07706-3492-4789-bb31-0717e228bd14}\"`.\n\n### Set\n\n\u003e Set a small number of parameters\n\n```\nUSAGE:\n    sbz-switch.exe set [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -b \u003cFEATURE\u003e \u003cPARAMETER\u003e \u003ctrue|false\u003e        Sets a boolean value\n    -d, --device \u003cDEVICE_ID\u003e                     Specify the device to act on (get id from list-devices)\n    -f \u003cFEATURE\u003e \u003cPARAMETER\u003e \u003cVALUE\u003e             Sets a floating-point value\n    -i \u003cFEATURE\u003e \u003cPARAMETER\u003e \u003cVALUE\u003e             Sets an integer value\n    -m \u003ctrue|false\u003e                              Temporarily mutes while changing parameters [default: true]\n    -v, --volume \u003cVOLUME\u003e                        Sets the volume, in percent\n```\n\nSwitch to speakers at 60% volume with effects turned on:\n\n    sbz-switch set -i \"Device Control\" SelectOutput 1 -b EfxMasterControl \"THXEfx Master OnOff\" true -v 60\n\nSwitch to headphones at 10% volume with effects turned off:\n\n    sbz-switch set -i \"Device Control\" SelectOutput 0 -b EfxMasterControl \"THXEfx Master OnOff\" false -v 10\n\n### Dump\n\n\u003e See or save the current parameters\n\n```\nUSAGE:\n    sbz-switch.exe dump [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -d, --device \u003cDEVICE_ID\u003e    Specify the device to act on (get id from list-devices)\n    -f \u003cFORMAT\u003e                 Select the output format [default: toml]  [possible values: toml, json, yaml]\n    -o, --output \u003cFILE\u003e         Saves the current settings to a file\n```\n\nSee the current settings:\n\n    sbz-switch dump\n\nSave the current settings to headphones.toml:\n\n    sbz-switch dump -o headphones.toml\n\nNote: saving parameters this way will include many parameters, some of which may not actually be settable when used with the `apply` command. It is recommended to remove unnecessary settings to speed up the transition and avoid errors.\n\n### Apply\n\n\u003e Set many parameters at once\n\n```\nUSAGE:\n    sbz-switch.exe apply [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -d, --device \u003cDEVICE_ID\u003e    Specify the device to act on (get id from list-devices)\n    -i \u003cFILE\u003e                   Reads the settings from a file instead of stdin\n    -f \u003cFORMAT\u003e                 Select the input format [default: toml]  [possible values: toml, json, yaml]\n    -m \u003ctrue|false\u003e             Temporarily mutes while changing parameters [default: true]\n```\n\nApply the previously saved headphones.toml file:\n\n    sbz-switch apply -i headphones.toml\n\nOmitting the `-i` parameter will cause sbz-switch to read settings from stdin.\n\nPartial dumps are acceptable (and recommended) input for the apply command, in which case the other parameters are left as is. This means it's possible to use a small toml files like these:\n\n#### headphones.toml\n```toml\n[creative.\"Device Control\"]\nSelectOutput = 0\n\n[creative.EfxMasterControl]\n\"THXEfx Master OnOff\" = false\n\n[endpoint]\nvolume = 0.1\n```\n\n#### speakers.toml\n```toml\n[creative.\"Device Control\"]\nSelectOutput = 1\n\n[creative.EfxMasterControl]\n\"THXEfx Master OnOff\" = true\n\n[endpoint]\nvolume = 0.6\n```\n\n### Watch\n\n\u003e Watch for events such as parameter changes\n\n```\nUSAGE:\n    sbz-switch.exe watch [OPTIONS]\n\nFLAGS:\n    -h, --help       Prints help information\n    -V, --version    Prints version information\n\nOPTIONS:\n    -d, --device \u003cDEVICE_ID\u003e    Specify the device to act on (get id from list-devices)\n```\n\n## Known issues\n\nThere may be a pop during the switch, or applications outputting audio may get confused. This seems to be a problem on Creative's end and happens for me even when switching using the official software.\n\nSome parameters are only valid if another parameter has been set or when using certain hardware, e.g. 7.1 surround sound speaker configuration. Unfortunately, these parameters will be included in a full parameter dump and may lead to errors when reapplying the settings later. It should be generally safe to ignore such errors, but they can be avoided by removing the offending settings from the dump file.\n\nOrder matters when setting parameters. This program make no attempt to order the parameters correctly itself. Additionally, toml files are read using [toml](https://crates.io/crates/toml) 0.4 which does not maintain the order of parameters.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdonoughe%2Fsbz-switch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdonoughe%2Fsbz-switch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdonoughe%2Fsbz-switch/lists"}