{"id":32867853,"url":"https://github.com/graysoncash/soundctl","last_synced_at":"2026-05-15T01:04:11.218Z","repository":{"id":323196726,"uuid":"1092454475","full_name":"graysoncash/soundctl","owner":"graysoncash","description":"🔊 A Swift command-line utility for controlling macOS audio devices. Switch between speakers, headphones, and microphones instantly from the terminal.","archived":false,"fork":false,"pushed_at":"2025-11-08T18:19:37.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-08T18:21:04.728Z","etag":null,"topics":["audio","audio-devices","cli","command-line-tool","coreaudio","macos","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/graysoncash.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-08T16:53:49.000Z","updated_at":"2025-11-08T18:06:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/graysoncash/soundctl","commit_stats":null,"previous_names":["graysoncash/soundctl"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/graysoncash/soundctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graysoncash%2Fsoundctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graysoncash%2Fsoundctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graysoncash%2Fsoundctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graysoncash%2Fsoundctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graysoncash","download_url":"https://codeload.github.com/graysoncash/soundctl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graysoncash%2Fsoundctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283469470,"owners_count":26841007,"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-11-09T02:00:05.828Z","response_time":62,"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":["audio","audio-devices","cli","command-line-tool","coreaudio","macos","swift"],"created_at":"2025-11-09T07:00:51.715Z","updated_at":"2025-11-09T07:02:18.145Z","avatar_url":"https://github.com/graysoncash.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔊 soundctl\n\nA command-line utility to control sound devices on macOS, written in Swift.\n\n## Description\n\nThis utility controls the sound devices for macOS. You specify the name of the sound device, such as \"Built-in Output\", and the utility switches the device immediately without any GUI interaction.\n\nThis is a command-line utility only and has no graphical user interface.\n\n## Installation\n\n### Homebrew\n\n```bash\nbrew tap graysoncash/soundctl\nbrew install soundctl\n```\n\n### Building from Source\n\n```bash\nswift build -c release\ncp .build/release/soundctl /usr/local/bin/\n```\n\nOr use the Makefile:\n\n```bash\nmake install\n```\n\n## Usage\n\n```bash\nsoundctl \u003csubcommand\u003e [options]\n```\n\n### Subcommands\n\n- **current** (default): Show current audio device\n- **list**: List all audio devices\n- **set** `\u003cidentifier\u003e`: Set the audio device\n- **next**: Cycle to the next audio device\n- **mute** `[action]`: Control mute status\n\n### Common Options\n\n- **--type, -t** `\u003ctype\u003e`: Device type (input/output/system/all). Defaults to output.\n- **--format, -f** `\u003cformat\u003e`: Output format (human/cli/json). Defaults to human. (Applies to `current` and `list`)\n\n## Examples\n\n### Show current device\n\n```bash\nsoundctl current\n# or just\nsoundctl\n```\n\nOutput:\n```\nSomeone's AirPods Max (XX-XX-XX-XX-XX-XX)\n```\n\n### Show current device (JSON format)\n\n```bash\nsoundctl current --format json\n```\n\nOutput:\n```json\n{\"id\":108,\"type\":\"output\",\"name\":\"Someone's AirPods Max\",\"uid\":\"XX-XX-XX-XX-XX-XX:output\"}\n```\n\n### List all output devices\n\n```bash\nsoundctl list\n```\n\n### List all input devices\n\n```bash\nsoundctl list --type input\n```\n\n### List all devices (JSON format)\n\n```bash\nsoundctl list --format json\n```\n\n### Set device by name\n\n```bash\nsoundctl set \"MacBook Pro Speakers\"\n```\n\n### Set device by MAC address\n\n```bash\nsoundctl set \"XX-XX-XX-XX-XX-XX\"\n```\n\n### Set device by ID\n\n```bash\nsoundctl set \"93\"\n```\n\nThe `set` command is smart and auto-detects the type of identifier:\n- **MAC address format** (XX-XX-XX-XX-XX-XX): Matches via UID\n- **Numeric ID**: Matches by device ID\n- **Anything else**: Matches by device name\n\nPriority order: MAC address → numeric ID → name (so a device named \"123\" can still be matched even if there's an ID 123)\n\n### Cycle to next device\n\n```bash\nsoundctl next\n```\n\n### Muting\n\nToggle the mute state for the currently selected input (e.g., microphone):\n\n```bash\nsoundctl mute toggle --type input\n# or just\nsoundctl mute\n```\n\nMute the input:\n\n```bash\nsoundctl mute on --type input\n```\n\nUnmute the input:\n\n```bash\nsoundctl mute off --type input\n```\n\nThis is useful on a hotkey, e.g., to mute your Teams or Zoom input.\n\n### Understanding IDs\n\n- **id**: Numeric identifier assigned by macOS at runtime. Can change between reboots or reconnections.\n- **uid**: Persistent unique identifier string (the MAC address for Bluetooth devices). This is the reliable identifier for matching devices.\n\n## Configuration\n\nYou can optionally create a configuration file at `~/.config/soundctl/config.json` to filter which devices appear in listings and when cycling with the `next` command.\n\n### Ignore Devices (Blocklist)\n\n```json\n{\n  \"ignoreDevices\": {\n    \"names\": [\"Virtual Device\", \"Aggregate Device\"],\n    \"uids\": [\"00-00-00-00-00-00\"]\n  }\n}\n```\n\n### Include Devices (Allowlist)\n\n```json\n{\n  \"includeDevices\": {\n    \"names\": [\"MacBook Pro Speakers\"],\n    \"uids\": [\"11-22-33-44-55-66\"]\n  }\n}\n```\n\n**Filter Priority:** If `includeDevices` has any entries, only those devices will be shown (allowlist mode). Otherwise, `ignoreDevices` will be used to exclude devices (blocklist mode). Both filters support:\n- **names**: Array of device name strings. Matches if the device name contains the string or vice versa.\n- **uids**: Array of UID strings (or MAC addresses). Matches if the device UID contains the string.\n\n## Requirements\n\n- macOS 13.0 or later\n- Swift 5.9 or later\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Credits\n\nOriginally inspired by [switchaudio-osx](https://github.com/deweller/switchaudio-osx) by Devon Weller.\n\nRewritten in Swift for improved macOS integration and maintainability.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraysoncash%2Fsoundctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraysoncash%2Fsoundctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraysoncash%2Fsoundctl/lists"}