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

Cannot get aggregate device to work with sounddevice/rtmixer signal processing.py example #506

Open
russellchung opened this issue Nov 28, 2023 · 1 comment

Comments

@russellchung
Copy link

I am new to sound device and rtmixer, I have the following aggregate device (2 USB mic +Apple EarPods built-in mic) in MacOSX:

Available Input Devices:
{'name': 'Aggregate Device', 'index': 6, 'hostapi': 0, 'max_input_channels': 4, 'max_output_channels': 0, ....,default_samplerate': 48000.0}
Available Output Devices:
{'name': 'Built-in Output', 'index': 1, 'hostapi': 0, 'max_input_channels': 0, 'max_output_channels': 2, ..., 'default_samplerate': 48000.0}

I can get the live plot mic.py to work (despite the fact that the built-in microphone really have one channel instead of two) but not the signal processing example to work. My declaration for the class is as follow:

stream = rtmixer.MixerAndRecorder(
device=[6,1], channels=[4,2], blocksize=0, latency=latency,
samplerate=samplerate)

I am wondering if my mistakes is on the queue or the stream class is not declared properly or the device/channels not declared correctly ? Thank you for any input and help!

@mgeier
Copy link
Member

mgeier commented Dec 1, 2023

What exactly is going wrong? Are you getting error/warning messages?

I don't have a lot of experience with aggregate devices, so I don't know if that will work, but why don't you add your output to the aggregate device as well?

And if all else fails, you can try to use separate Mixer and Recorder objects. You could then call play_ringbuffer() on one and record_ringbuffer() on the other. I guess the rest of the signal processing example could stay the same.

the built-in microphone really have one channel instead of two

This is interesting, but it is not under my control. Either the aggregate device creates one more channel than necessary or the PortAudio library does that.

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

2 participants