[pulseaudio-discuss] Question about pulseaudio sources and sinks

Damir Jelić poljarinho at gmail.com
Fri Oct 11 10:36:39 CEST 2013


On Fri, Oct 11, 2013 at 12:42:53PM +0800, Jonathan Wilson wrote:
> I have a pulseaudio module which calls pa_source_new to create an
> audio source and pa_sink_new to create an audio sink. I have another
> piece of code that makes calls to PulseAudio to feed audio into the
> sink and get audio from the source.
> Can anyone point me at:
> 1.Documentation for the source and sink APIs

The sinks and sources are not part of the public API. The only API
documentation that I'm aware of is directly inside sink.h [1] and sorce.h [2].

> and 2.Information on which APIs I should be grepping for in order to
> see where the other code says "hey, I want to feed audio to sink
> xyz" and "hey, I want to pull audio from source xyz"

If you want to create a PulseAudio client for playback and recording
there are two possibilities:
    - Pulse Simple API [3]
    - Pulse Asynchronous API [4]

The former is rather limited and uses a blocking interface but should
you get going faster.

Also there is 'pacat.c' [5] inside the tree which implements exactly what
you want.

[1] http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/pulsecore/sink.h
[2] http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/pulsecore/source.h
[3] http://freedesktop.org/software/pulseaudio/doxygen/simple.html
[4] http://freedesktop.org/software/pulseaudio/doxygen/async.html
[5] http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/utils/pacat.c


More information about the pulseaudio-discuss mailing list