Add support for 24 bit output devices on Windows · Issue #85 · processing/processing-sound (original) (raw)

Many audio interfaces currently throw a javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported on Windows because 16 bit resolution is hard-coded in JSyn's JavaSoundAudioDevice (or don't list any audio devices to begin with, such as the Motu Ultralite mk5).

This might be fixable by bundling the JPortAudio bindings for Windows and making use of the JPortAudioDevice instead.

Work-in-progress

It turns out that getting (and) keeping the engine and synth in a valid state between device manager/synth switches is actually quite tricky. It goes something like this:

Assuming we are on JavaSound:

After this first (silent) startup, there is a running SynthesisEngine with volume and output nodes.

Whenever the user selects a different input or output device, do the following:

Two outstanding glitches/corner cases: