[pulseaudio-discuss] java sound implementation using pulseaudio - ports

Ioana Ivan iivan at redhat.com
Thu Aug 21 13:49:01 PDT 2008


We've been trying to write an implementation of 
javax.sound.sampled.Mixer(and the associated classes: SourceDataLine, 
TargetDataLine, Clip, and Port) that uses pulseaudio as a backend. So 
far, SourceDataLine, TargetDataLine and Clip are working (somewhat, 
there are still issues that need to be fixed), but we're not sure how to 
approach Port.

 From the java API:
"Ports are simple lines for input or output of audio to or from audio 
devices. Common examples of ports that act as source lines (mixer 
inputs) include the microphone, line input, and CD-ROM drive. Ports that 
act as target lines (mixer outputs) include the speaker, headphone, and 
line output. You can access port using a Port.Info  object."

Ports should have an open() and close() method, and ideally they should 
also support volume and mute controls. There currently is an 
implementation of Port in openjdk that uses alsa to enumerate the 
devices that could connect to the sound system, and implement the 
required methods.

We were wondering whether there's anything in the pulseaudio API that 
could be used to do something similar, and, if not, how problematic 
using the old version of Port(that uses alsa directly) with our mixer 
that uses pulseaudio is.

Thank you,
Ioana Ivan

More information about the pulseaudio-discuss mailing list