PulseAudio ‘simple’ provides a simple but limited synchronous playback and recording API. This
is a synchronous, simplified wrapper around the standard asynchronous API.

About

This library is a binding that allows Rust code to connect to the PulseAudio sound server via
PulseAudio’s existing C API. This binding provides a safe(r) Rust interface which might be
preferred over the raw C API provided by the underlying sys linking crate.

This crate provides an interface to PulseAudio’s ‘simple’ component, and should be used in
addition to the general libpulse_binding crate.

Introduction

The simple API is designed for applications with very basic sound playback or capture needs. It
can only support a single stream per connection and has no support for handling of complex
features like events, channel mappings and volume control. It is, however, very simple to use
and quite sufficient for many programs.

Usage

Firstly, add a dependency on the crate in your program’s Cargo.toml file. Secondly, import the
crate along with the general libpulse_binding crate to the root of your program:

Transferring data

Once the connection is established to the server, data can start flowing. Using the connection
is very similar to the normal read() and write() system calls using read and write
methods of the Simple object. Note that these operations always block.

Buffer control

Simple::get_latency: Will return the total latency of the playback or record pipeline,
respectively.