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

Support multiple AudioIn channels, honour input_device_name #117

Open
jarmitage opened this issue May 23, 2024 · 4 comments
Open

Support multiple AudioIn channels, honour input_device_name #117

jarmitage opened this issue May 23, 2024 · 4 comments

Comments

@jarmitage
Copy link

throw std::runtime_error("Multiple AudioIn nodes are not yet supported.");

@ideoforms
Copy link
Owner

Funnily enough, you raised this at the precise moment that I also need this feature so I'm working on this as I speak. Should be done later today!

@ideoforms
Copy link
Owner

OK, I looked at this and unforunately it's a larger refactor than I have time to do right now as i'm on a project deadline. However! You can achieve the same effect with a workaround, which is what I'm doing:

# read the full multichannel input here
all_input_channels = AudioIn(8)
# then use the subscript operator to select individual mono channels
first_channel = all_input_channels[0]
second_channel = all_input_channels[1]

I'll leave this issue open to remind me to fix it properly at some point...

@jarmitage
Copy link
Author

I can't get all_input_channels = AudioIn(8) to work:

python signalflow-examples/audio-through-example.py
Output device: BlackHole 64ch (44100Hz, buffer size 4096 samples, 24 channels)
Traceback (most recent call last):
  File "../signalflow-examples/audio-through-example.py", line 34, in <module>
    main()
  File "../signalflow-examples/audio-through-example.py", line 21, in main
    audio_in = AudioIn(8)
               ^^^^^^^^^^
signalflow.AudioIOException: AudioIn: Not enough input channels available (requested 8, available 1)
[1]    35077 segmentation fault  python signalflow-examples/audio-through-example.py

@ideoforms ideoforms changed the title Support multiple AudioIn channels Support multiple AudioIn channels, honour input_device_name Jun 20, 2024
@ideoforms
Copy link
Owner

Hmm, this would happen if the audio input device of SignalFlow has fewer than 8 channels.
If you set your system's default input device to (say) BlackHole 64ch, this should resolve the issue.

In investigating this, I've also found that input_device_name is not honoured in .signalflow/config (or SIGNALFLOW_INPUT_BUFFER_SIZE), which should be addressed in the same fix as for the wider AudioIn issue.

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