spxl / spxlAudioToMidi

Tool to produce MIDI control messages from a live audio feed using FFT
3 stars 0 forks source link

Option to select audio device #1

Open spxl opened 11 years ago

spxl commented 11 years ago

\ This is a test of the GitHub issue system... **

In Windows at least, you can have multiple versions of this sketch/app running simultaneously, "listening" to separate audio devices.

The only way I know to choose the device, however, is to go to the "Recording Devices" section of the sound control panel and set the default recording device, BEFORE starting the sketch/app.

Some problems with allowing the audio device to be selected include having to provide an interface to selection... and if it needs to be chosen every time, that is going to be a hassle.

Minim's Javadocs suggest there is a constructor with a second parameter:

Minim(processing.core.PApplet parent, MinimServiceProvider msp) Creates an instance of Minim that will use the provided implementation for audio.

The provided JSMinim class implements MinimServiceProvider (http://code.compartmental.net/minim/javadoc/ddf/minim/javasound/JSMinim.html) but the Minim(p5, jsminim) constructor isn't working for me (not found, even).

See http://stackoverflow.com/questions/4211439/getting-the-system-sound-in-java for an example of how to enumerate the available "Mixer"devices/objects available in the system.

spxl commented 10 years ago

printMixersDetails() enumerates the available mixers.

v08 introduces two variables to store mixers found in the enumeration phase (printMixersDetails() should be renamed, I suppose!): one for the "Microphone" and one for the "Stereo Mix". Obviously the strings I'm searching for may not match the names of the mixers on another system, but they work for me for now on my Windows 7 machine. Generating a menu (similar to the MIDI in/out device selections) is probably the best way to deal with this.

I can now select Microphone and Stereo Mixer within one session of the program running, however there is a problem when I try to select the same mixer a second time; I only seem to be able to get an input stream for FFT analysis the first time. Please help! :o)