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

Replace (or remove) PyAudio from codebase and requirements #3

Open
a-hurst opened this issue Nov 14, 2019 · 0 comments
Open

Replace (or remove) PyAudio from codebase and requirements #3

a-hurst opened this issue Nov 14, 2019 · 0 comments
Assignees

Comments

@a-hurst
Copy link
Owner

a-hurst commented Nov 14, 2019

Internally, we use PyAudio for recording microphone responses from the AudioResponse ResponseListener, and SDL2 + SDL2_mixer for all audio output. At the time of writing, PyAudio only has pre-built binary wheels for Windows (meaning you need to jump through a bunch of hoops to install portaudio on macOS), and even on Windows there's no PyPi wheel for Python 3.7, making its use on Windows with the current version of Python almost impossible.

I've already moved PyAudio to an optional dependency in klibs to get around this, but going forwards we should look into replacing PyAudio with another library that has current and cross-platform pre-built wheels (i.e. doesn't require a compiler or external library to install), or alternatively just removing it altogether and making AudioResponses just be a custom per-project listener (since currently only one project uses it).

Alternative libraries:

  • SDL2: Has built-in microphone support as of 2.0.5, would be ideal since it means we can retain AudioListener support without any extra external dependencies. The main drawback here is that it's all obscure C stuff, and I've had trouble getting it working properly on my system (though I do have it working partially in a local branch). Very little documentation to be found. Not sure what the latency is like.

  • SoundDevice: Has current, pre-built binaries for macOS and win32/win64 and supports both Python 2.7 and 3.x. Main drawback is adding another dependency, although the project also doesn't have linux wheels unfortunately. Don't know what the latency is like.

@a-hurst a-hurst self-assigned this Nov 14, 2019
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