Skip to content

Conversation

@HalbFettKaese
Copy link

This PR adds a new backend that wraps the sounddevice python package. Currently, the sounddevice package is just imported through requirements.txt, as I was unsure if or how to add it as an optional dependency. Any new Aserver tries to use the new sounddevice backend over the previous pyaudio backend.

One benefit of sounddevice over pyaudio is that it can refresh the device list from within an IPython Notebook without needing to reload the kernel. For example:

from pya.gui import AserverGUI
# Create new server GUI.
# Disconnect/reconnect different devices, or switch the standard output device on your PC,
# and see the device list change after rebooting.
asgui = AserverGUI()
from pya import Arecorder
# Read standard input device name.
# See the result change when re-running after rebooting the server using the GUI.
rec = Arecorder().boot()
rec.device_dict["name"]

The PR also involves an internal restructuring of the AserverGUI, as the previous version was unable to handle a changing device list. One change in behavior compared to before is that the GUI now instantly initializes the default server, when previously it would only do so after the user clicked the "(re)boot" button once.

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

Successfully merging this pull request may close these issues.

1 participant