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::CallbackTimeInfo as StreamCallbackTimeInfo;
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
- A module for implementing the Portaudio Error type and implementing the std Error trait.
- Portaudio platform specific extensions.
- This module aims to provide a user-friendly rust-esque wrapper around the portaudio Stream types.
Structs
- The type used to refer to audio devices.
- A structure providing information and capabilities of PortAudio devices.
- An iterator yielding the DeviceIndex for each available device along with their respective DeviceInfos.
- A structure containing information about a particular host API.
- An iterator yielding the HostApiIndex for each available API along with their respective HostApiInfos.
- Structure used to return information about a host error condition.
- The lifetime of the
PortAudio
instance. - A type-safe wrapper around the PortAudio API.
Enums
- Unchanging unique identifiers for each supported host API
- A type used to dynamically represent the various standard sample formats (usually) supported by all PortAudio implementations.
Constants
- 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
- public trait to constraint pa::Stream for specific types
Functions
- Retrieve the size of a given sample format in bytes.
- Retrieve the release number of the currently running PortAudio build.
- Retrieve a textual description of the current PortAudio build.
Type Definitions
- An type alias used to represent a given number of frames.
- The type used to enumerate to host APIs at runtime. Values of this type range from 0 to (pa::get_host_api_count()-1).
- Allowable return values for the PaStreamCallback. @see PaStreamCallback
- The type used to represent monotonic time in seconds.