Ejemplo n.º 1
0
def main():
    args = get_args()
    pysoundio = PySoundIo(backend=args.backend)
    input_devices, output_devices = pysoundio.list_devices()
    print('\n' + '-' * 20 + ' Input Devices ' + '-' * 20 + '\n')
    print_devices(input_devices)

    print('\n' + '-' * 20 + ' Output Devices ' + '-' * 20 + '\n')
    print_devices(output_devices)

    pysoundio.close()
Ejemplo n.º 2
0
            [str(d) for d in device['formats']['available']])))
        print('\tlayouts: {}'.format(device['layouts']['current']['name']))
        print('\t available: {}'.format(', '.join(
            [str(d['name']) for d in device['layouts']['available']])))
        print('\tsoftware latency:')
        print('\t min: {}s, max: {}s, current: {}s'.format(
            round(device['software_latency_min'], 4),
            round(device['software_latency_max'], 4),
            round(device['software_latency_current'], 4)))
        print("")


if __name__ == '__main__':
    parser = argparse.ArgumentParser(
        description='PySoundIo list devices example',
        epilog='List the available input and output devices')
    parser.add_argument('--backend',
                        type=int,
                        help='Backend to use (optional)')
    args = parser.parse_args()

    pysoundio = PySoundIo(backend=args.backend)
    input_devices, output_devices = pysoundio.list_devices()
    print('\n' + '-' * 20 + ' Input Devices ' + '-' * 20 + '\n')
    print_devices(input_devices)

    print('\n' + '-' * 20 + ' Output Devices ' + '-' * 20 + '\n')
    print_devices(output_devices)

    pysoundio.close()