Add resamplers' info for palace-info (#75)

This commit is contained in:
Ngô Ngọc Đức Huy 2020-04-18 08:06:36 +07:00 committed by GitHub
parent 8a6ce4bd13
commit c9134b31e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -19,7 +19,7 @@
from argparse import ArgumentParser
from palace import device_names, Device
from palace import device_names, Device, Context
parser = ArgumentParser()
@ -37,6 +37,13 @@ with args.device:
print(f'\nInfo of device {args.device.name!r}:')
print('ALC version: {}.{}'.format(*args.device.alc_version))
with Context(args.device) as ctx:
default_idx = ctx.default_resampler_index
resamplers = ctx.available_resamplers
resamplers[default_idx] += ' (default)'
print('Available resamplers:', *resamplers, sep='\n ')
efx = args.device.efx_version
if efx == (0, 0):
print('EFX not supported!')