Command-line utilities for macOS to configure and list audio devices using CoreAudio.
- ConfAudioDev: Change the sample rate and bit depth of a specified audio device.
- ListAudioDev: List all audio devices, showing their direction (input/output), channel count, sample rate, and bit depth.
- macOS 12.0 or later
- Swift toolchain
- Xcode command line tools (for
swiftc,lipo, etc.)
A helper script build.sh compiles both tools into universal Intel + ARM binaries.
# Make build script executable (once)
chmod +x build.sh
# Run build script
./build.shThis produces:
ConfAudioDev(universal binary)ListAudioDev(universal binary)
Set the sample rate and bit depth for a device by name.
# Syntax:
./ConfAudioDev "<DeviceName>" "<bits>b<frequency>"
# Examples:
./ConfAudioDev "BlackHoleA" "24b96000" # Set to 24-bit, 96 kHz
./ConfAudioDev "Built-in Output" "16b44100" # Set to 16-bit, 44.1 kHzList all audio devices with their current configuration.
./ListAudioDevDevice Name Dir Channels SampleRate BitDepth
---------------- -------------- -------------- -------------- --------------
Built-in Input IN 2 44100Hz 16bit
Built-in Output OUT 2 44100Hz 16bit
BlackHoleA IN 2 48000Hz 24bit
BlackHoleA OUT 2 48000Hz 24bit
The build script automatically removes intermediate architecture-specific binaries (*_x86_64, *_arm64).
Feel free to file issues or pull requests to add new tools, features, or improvements.
MIT License. See LICENSE for details.