Crate weresocool_portaudio

Crate weresocool_portaudio 

Source
Expand description

§rust-portaudio

PortAudio bindings for Rust

PortAudio provides a uniform application programming interface (API) across all supported platforms. You can think of the PortAudio library as a wrapper that converts calls to the PortAudio API into calls to platform-specific native audio APIs. Operating systems often offer more than one native audio API and some APIs (such as JACK) may be available on multiple target operating systems. PortAudio supports all the major native audio APIs on each supported platform.

§Installation

rust-portaudio’s build script will check to see if you have already installed PortAudio on your system. If not, it will attempt to automatically download and install it for you. If this fails, please let us know by posting an issue at [our github repository] (https://github.com/jeremyletang/rust-portaudio).

If you’d prefer to install it manually, you can download it directly from the website: PortAudio.

§Usage

Add rust-portaudio to your project by adding the dependency to your Cargo.toml as follows:

[dependencies]
portaudio = "*"

Re-exports§

pub use error::Error;
pub use stream::callback_flags as stream_callback_flags;
pub use stream::flags as stream_flags;
pub use stream::Available as StreamAvailable;
pub use stream::Blocking;
pub use stream::CallbackFlags as StreamCallbackFlags;
pub use stream::Duplex;
pub use stream::DuplexCallbackArgs as DuplexStreamCallbackArgs;
pub use stream::DuplexSettings as DuplexStreamSettings;
pub use stream::Flags as StreamFlags;
pub use stream::Flow;
pub use stream::Info as StreamInfo;
pub use stream::Input;
pub use stream::InputCallbackArgs as InputStreamCallbackArgs;
pub use stream::InputSettings as InputStreamSettings;
pub use stream::NonBlocking;
pub use stream::Output;
pub use stream::OutputCallbackArgs as OutputStreamCallbackArgs;
pub use stream::OutputSettings as OutputStreamSettings;
pub use stream::Parameters as StreamParameters;
pub use stream::Settings as StreamSettings;
pub use stream::Stream;

Modules§

error
A module for implementing the Portaudio Error type and implementing the std Error trait.
ext
Portaudio platform specific extensions.
stream
This module aims to provide a user-friendly rust-esque wrapper around the portaudio Stream types.

Structs§

DeviceIndex
The type used to refer to audio devices.
DeviceInfo
A structure providing information and capabilities of PortAudio devices.
Devices
An iterator yielding the DeviceIndex for each available device along with their respective DeviceInfos.
HostApiInfo
A structure containing information about a particular host API.
HostApis
An iterator yielding the HostApiIndex for each available API along with their respective HostApiInfos.
HostErrorInfo
Structure used to return information about a host error condition.
Life
The lifetime of the PortAudio instance.
PortAudio
A type-safe wrapper around the PortAudio API.

Enums§

HostApiTypeId
Unchanging unique identifiers for each supported host API
SampleFormat
A type used to dynamically represent the various standard sample formats (usually) supported by all PortAudio implementations.

Constants§

Abort
Complete
Continue
FRAMES_PER_BUFFER_UNSPECIFIED
The special value may be used to request that the stream callback will receive an optimal (and possibly varying) number of frames based on host requirements and the requested latency settings.

Traits§

Sample
public trait to constraint pa::Stream for specific types

Functions§

get_sample_size
Retrieve the size of a given sample format in bytes.
version
Retrieve the release number of the currently running PortAudio build.
version_text
Retrieve a textual description of the current PortAudio build.

Type Aliases§

Frames
An type alias used to represent a given number of frames.
HostApiIndex
The type used to enumerate to host APIs at runtime. Values of this type range from 0 to (pa::get_host_api_count()-1).
StreamCallbackResult
Allowable return values for the PaStreamCallback. @see PaStreamCallback
Time
The type used to represent monotonic time in seconds.