Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JACK via PortAudio #1

Open
mgeier opened this issue Sep 28, 2015 · 0 comments
Open

JACK via PortAudio #1

mgeier opened this issue Sep 28, 2015 · 0 comments

Comments

@mgeier
Copy link

mgeier commented Sep 28, 2015

This is a reaction to the statement in the README:

PyAudio offers a binding for the old good PortAudio, it works everywhere but is quite low-level and if you are using Jack can be painful (ok, it is supported, but I was not able to create a client, nor to find working code by someone else).

The problem with PortAudio (at least the version I'm currently using, probably this will be improved in future versions) is that JACK is never the default host API, even if jackd is running (and blocking all other host APIs).

This is inconvenient, but it is still possible to select JACK via its device ID. With PyAudio this can be done with the arguments input_device_index and output_device_index.

I didn't like the API of PyAudio, so I created my own: python-sounddevice (which is based on PySoundCard). Using that, I tried to come up with a way to select JACK's main device, but I must confess that it's still not very nice:

import sounddevice as sd

try:
    device, = (x[0] for x in enumerate(sd.query_devices()) if x[1]['name'] == 'system')
except ValueError:
    device = None

Probably this can be improved once spatialaudio/python-sounddevice#2 is done ...

If you have some other suggestions, I'd be happy to include them in the sounddevice module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant