pa_simple *s; pa_sample_spec ss; ss.format = PA_SAMPLE_S16_NE; ss.channels = 2; ss.rate = 44100; s = pa_simple_new(NULL, // Use the default server. "Fooapp", // Our application's name. PA_STREAM_PLAYBACK, NULL, // Use the default device. "Music", // Description of our stream. &ss, // Our sample format. NULL, // Use default channel map NULL, // Use default buffering attributes. NULL, // Ignore error code. );
At this point a connected object is returned, or NULL if there was a problem connecting.
pa_simple_free(s);