diff options
author | Chris Robinson <[email protected]> | 2022-12-31 11:49:44 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-12-31 11:49:44 -0800 |
commit | cba526e1b082150f4a7160775f2ee6cb2deb024c (patch) | |
tree | 5c83340a57e79ec77ebb482427ae174d10ee0867 /utils | |
parent | fa52ceaf2683371c7910047b0d17c486a556299e (diff) |
Display the device sample rate in openal-info
Diffstat (limited to 'utils')
-rw-r--r-- | utils/openal-info.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/openal-info.c b/utils/openal-info.c index 959324cc..b646693c 100644 --- a/utils/openal-info.c +++ b/utils/openal-info.c @@ -183,6 +183,8 @@ static void printHRTFInfo(ALCdevice *device) static void printModeInfo(ALCdevice *device) { + ALCint srate = 0; + if(alcIsExtensionPresent(device, "ALC_SOFT_output_mode")) { const char *modename = "(error)"; @@ -203,10 +205,14 @@ static void printModeInfo(ALCdevice *device) case ALC_SURROUND_6_1_SOFT: modename = "6.1 Surround"; break; case ALC_SURROUND_7_1_SOFT: modename = "7.1 Surround"; break; } - printf("Output channel mode: %s\n", modename); + printf("Device output mode: %s\n", modename); } else printf("Output mode extension not available\n"); + + alcGetIntegerv(device, ALC_FREQUENCY, 1, &srate); + if(checkALCErrors(device) == ALC_NO_ERROR) + printf("Device sample rate: %dhz\n", srate); } static void printALInfo(void) |