simple.h File Reference

A simple but limited synchronous playback and recording API. More...

Go to the source code of this file.

Typedefs

typedef struct pa_simple pa_simple

Functions

pa_simplepa_simple_new (const char *server, const char *name, pa_stream_direction_t dir, const char *dev, const char *stream_name, const pa_sample_spec *ss, const pa_channel_map *map, const pa_buffer_attr *attr, int *error)
 Create a new connection to the server.
void pa_simple_free (pa_simple *s)
 Close and free the connection to the server.
int pa_simple_write (pa_simple *s, const void *data, size_t bytes, int *error)
 Write some data to the server.
int pa_simple_drain (pa_simple *s, int *error)
 Wait until all data already written is played by the daemon.
int pa_simple_read (pa_simple *s, void *data, size_t bytes, int *error)
 Read some data from the server.
pa_usec_t pa_simple_get_latency (pa_simple *s, int *error)
 Return the playback latency.
int pa_simple_flush (pa_simple *s, int *error)
 Flush the playback buffer.


Detailed Description

A simple but limited synchronous playback and recording API.

This is a synchronous, simplified wrapper around the standard asynchronous API.


Typedef Documentation

typedef struct pa_simple pa_simple


Function Documentation

int pa_simple_drain ( pa_simple s,
int *  error 
)

Wait until all data already written is played by the daemon.

Examples:
pacat-simple.c.

int pa_simple_flush ( pa_simple s,
int *  error 
)

Flush the playback buffer.

void pa_simple_free ( pa_simple s  ) 

Close and free the connection to the server.

The connection objects becomes invalid when this is called.

Examples:
pacat-simple.c, and parec-simple.c.

pa_usec_t pa_simple_get_latency ( pa_simple s,
int *  error 
)

Return the playback latency.

Examples:
pacat-simple.c.

pa_simple* pa_simple_new ( const char *  server,
const char *  name,
pa_stream_direction_t  dir,
const char *  dev,
const char *  stream_name,
const pa_sample_spec ss,
const pa_channel_map map,
const pa_buffer_attr attr,
int *  error 
)

Create a new connection to the server.

Parameters:
server  Server name, or NULL for default
name  A descriptive name for this client (application name, ...)
dir  Open this stream for recording or playback?
dev  Sink (resp. source) name, or NULL for default
stream_name  A descriptive name for this client (application name, song title, ...)
ss  The sample type to use
map  The channel map to use, or NULL for default
attr  Buffering attributes, or NULL for default
error  A pointer where the error code is stored when the routine returns NULL. It is OK to pass NULL here.
Examples:
pacat-simple.c, and parec-simple.c.

int pa_simple_read ( pa_simple s,
void *  data,
size_t  bytes,
int *  error 
)

Read some data from the server.

Examples:
parec-simple.c.

int pa_simple_write ( pa_simple s,
const void *  data,
size_t  bytes,
int *  error 
)

Write some data to the server.

Examples:
pacat-simple.c.


Generated on Mon Jun 14 16:31:37 2010 for PulseAudio by  doxygen 1.5.6