# Sound library -\> get 2 different audio Inputs

**URL:** <https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705>\
**Category:** Libraries\
**Created:** [April 13, 2023, 9:48am UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705 "2023-04-13T09:48:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlesgutierrez](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/carlesgutierrez/32/2844_2.png) [@carlesgutierrez](https://discourse.processing.org/u/carlesgutierrez)\
**Post date:** [April 13, 2023, 9:48am UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705/1 "2023-04-13T09:48:07Z")

</div>

Hi dears,  
I’ve been using sound library to capture audio and check & visualize the FFT of an audio Input. I’m using windows10 and selecting my audio input from sound properties as is explained [in this post -\>getting-live-audio-input](https://discourse.processing.org/t/getting-live-audio-input/23143/6)

I need to create another processing App in parallel capturing and analyzing FFT from another audio input source. But if I’ve to change this from windows setup I will not be able to have 2 APPs running with differents devices.

¿Any idea how to achive this?

Extra question:  
What is really doing [Audio In](https://processing.org/reference/libraries/sound/AudioIn.html) I’m not able setup different values from 0 or 1. And I’m using several audio devices connected.

Sound.list() returns “available audio devices and their number of input/output channels”.  
It’s supposed to work If I choose any of them with **Audio in**?

Here my sound list output.  
_3- USB Audio CODEC is my primary audio input and I would like to be able to connect to others_ I need to connect to (3- USB Audio CODEC ) and NDI webcam input 1.

But Audio In as commented before only allow me 0 or 1. Anything else returns: **java.lang.RuntimeException: Audio Input not configured in start() method.**

> device id 0: Port Speakers (3- USB Audio CODEC )  
> max inputs : 0  
> max outputs: 0  
> device id 1: Port default (Realtek Audio)  
> max inputs : 0  
> max outputs: 0  
> device id 2: Port NDI Webcam 2 (NewTek NDI Audio)  
> max inputs : 0  
> max outputs: 0  
> device id 3: Port Microphone (Realtek Audio)  
> max inputs : 0  
> max outputs: 0  
> device id 4: Port Microphone (WO Mic Device)  
> max inputs : 0  
> max outputs: 0  
> device id 5: Port NDI Webcam 3 (NewTek NDI Audio)  
> max inputs : 0  
> max outputs: 0  
> device id 6: Port NDI Webcam 1 (NewTek NDI Audio)  
> max inputs : 0  
> max outputs: 0  
> device id 7: Port Microphone (3- USB Audio CODEC  
> max inputs : 0  
> max outputs: 0  
> device id 8: Port NDI Webcam 4 (NewTek NDI Audio)  
> max inputs : 0  
> max outputs: 0  
> device id 9: Primary Sound Driver  
> max inputs : 0  
> max outputs: 2 (default)  
> device id 10: Speakers (3- USB Audio CODEC )  
> max inputs : 0  
> max outputs: 2  
> device id 11: default (Realtek Audio)  
> max inputs : 0  
> max outputs: 2  
> device id 12: Primary Sound Capture Driver  
> max inputs : 2 (default)  
> max outputs: 0  
> device id 13: Microphone (3- USB Audio CODEC )  
> max inputs : 2  
> max outputs: 0  
> device id 14: NDI Webcam 2 (NewTek NDI Audio)  
> max inputs : 2  
> max outputs: 0  
> device id 15: Microphone (Realtek Audio)  
> max inputs : 2  
> max outputs: 0  
> device id 16: Microphone (WO Mic Device)  
> max inputs : 2  
> max outputs: 0  
> device id 17: NDI Webcam 3 (NewTek NDI Audio)  
> max inputs : 2  
> max outputs: 0  
> device id 18: NDI Webcam 1 (NewTek NDI Audio)  
> max inputs : 2  
> max outputs: 0  
> device id 19: NDI Webcam 4 (NewTek NDI Audio)  
> max inputs : 2  
> max outputs: 0

---

<div class="post-metadata">

**Author:** ![robertesler](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@robertesler](https://discourse.processing.org/u/robertesler)\
**Post date:** [April 14, 2023, 2:36am UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705/2 "2023-04-14T02:36:45Z")

</div>

Hi @carlesgutierrez.  
Have you tried using `inputDevice()`

> **[inputDevice() / Libraries](https://processing.org/reference/libraries/sound/Sound_inputDevice_.html)**
>
> Choose the device (sound card) which should be used for grabbing audio input using AudioIn. Note that this setting affects the choice of sound card, which is not necessarily the same as the number of …

It may let you run two sketches on different audio devices.

---

<div class="post-metadata">

**Author:** ![carlesgutierrez](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/carlesgutierrez/32/2844_2.png) [@carlesgutierrez](https://discourse.processing.org/u/carlesgutierrez)\
**Post date:** [April 14, 2023, 11:22am UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705/3 "2023-04-14T11:22:26Z")

</div>

Yah! inputDevice() is what I needed. Thanks!  
I’m using it as Documentation says, but still not working. I’ve checked if there are issues related to inputDevice but not for now. Is it working for you? In my case is not responding. Always getting the default audio input for all inputDevice numbers I’ve tried.

```auto
  //AUDIO
  Sound.list();
  s = new Sound(this);
  s.inputDevice(1);
  in = new AudioIn(this, 0);
  // start the Audio Input
  in.start();

```

I’m trying to select “device id 1: Port Speakers (3- USB Audio CODEC )” with id 1, but is using 0 one: “device id 0: Port default (Realtek Audio)”

Here my output: “Sound library error: audio device #1 has no input channels”

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [April 14, 2023, 2:21pm UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705/4 "2023-04-14T14:21:57Z")

</div>

Hi

Try to test your inputs with other software and see the configuration and setting of your sound system

---

<div class="post-metadata">

**Author:** ![carlesgutierrez](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/carlesgutierrez/32/2844_2.png) [@carlesgutierrez](https://discourse.processing.org/u/carlesgutierrez)\
**Post date:** [April 16, 2023, 8:48am UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705/5 "2023-04-16T08:48:56Z")

</div>

Hi @jafal I’ve tried with Arena Resolume and It works.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 16, 2023, 12:59pm UTC](https://discourse.processing.org/t/sound-library-get-2-different-audio-inputs/41705/6 "2023-04-16T12:59:21Z")

</div>

> [@carlesgutierrez](#):
>
> I’m trying to select “device id 1: Port Speakers (3- USB Audio CODEC )” with id 1, but is using 0 one: “device id 0: Port default (Realtek Audio)”
> 
> Here my output: “Sound library error: audio device #1 has no input channels”

Scrutinize the list of devices you provided.  
The list indicates if there are inputs or outputs available.  
Only use devices with a _inputs_ or _outputs_ accordingly.

See _Configuration_ section here:

> **[Sound / Libraries](https://processing.org/reference/libraries/sound/index.html)**
>
> Playback audio files, audio input, synthesize sound, and effects.

I was able to run separate apps with different devices once they were configured properly.

`:)`
