alto 0.2.4

Idiomatic interface for OpenAL 1.1 and extensions (EFX support is WIP)

Crate alto [] [src]

Overview

Alto is an idiomatic wrapper for the OpenAL 3D audio API and associated extensions (EFX support is still WIP). This documentation will describe how the API was adapted for rust, but for more general information about OpenAL, the official documentation should be consulted.

The core of the API is the Alto struct. From this struct audio devices can be enumerated and opened. Once a Device or LoopbackDevice is opened, a Context can be created from it. The context governs properties of the listener and allows you to allocate audio Buffers. These buffers can then be played with either a StaticSource or StreamingSource, which are also allocated from the context.

Modules

ext
sys

Structs

ALawSample
Alto

This struct is the entry point of the API. Instantiating it will load an OpenAL implementation dynamically. From here, available devices can be queried and opened.

BFormat2D
BFormat3D
Buffer

A buffer containing audio data of any supported format.

CaptureDevice

A capture device from which audio data can be sampled. This is tyically an audio input as reported by the operating system.

Context
ContextAttrs

Attributes that may be supplied during context creation.

Device

An audio device as exposed by the OpenAL implementation. This will typically be a device endpoint as reported by the operating system.

LoopbackAttrs

Attributes that may be supplied during context creation from a loopback device.

LoopbackDevice

A loopback device as provided by the ALC_SOFT_loopback extension.

Mc51Chn
Mc61Chn
Mc71Chn
McQuad
McRear
Mono
MuLawSample
SoftPauseLock

An RAII guard that keeps a device paused. When this lock is dropped, the device will resume playback.

StaticSource

A source that can play shared static buffer.

Stereo
StreamingSource

A source that plays a queue of owned buffers.

SuspendLock

An RAII lock that will suspend state updates while held. When this lock is droopped, the context will apply all pending updates.

Enums

AltoError

An error as reported by alcGetError or alGetError.

DistanceModel

The shape of the volume curve for 3D positional audio.

ExtALawFormat

Formats provided by AL_EXT_ALAW.

ExtBFormat

Formats provided by AL_EXT_BFORMAT.

ExtDoubleFormat

Formats provided by AL_EXT_double.

ExtFloat32Format

Formats provided by AL_EXT_float32.

ExtIma4Format

Formats provided by AL_EXT_IMA4.

ExtMcFormat

Formats provided by AL_EXT_MCFORMATS.

ExtMuLawBFormat

Formats provided by AL_EXT_MULAW_BFORMAT.

ExtMuLawFormat

Formats provided by AL_EXT_MULAW.

ExtMuLawMcFormat

Formats provided by AL_EXT_MULAW_MCFORMATS.

Format

Audio formats supported by OpenAL.

LoopbackFormatChannels

Channel format for a loopback context.

LoopbackFormatType

Sample format for a loopback context.

SoftHrtfStatus

The current HRTF mode of a device.

SoftMsadpcmFormat

Formats provided by AL_SOFT_MSADPCM.

SourceState

Playstack state of a source.

StandardFormat

Standard formats defined in the base specification.

Traits

AsBufferData
AsBufferDataMut
Block
DeviceTrait

Common capabilities expoed by both real and loopback devices.

LoopbackFrame

A sample frame that is supported as a loopback device output format.

SampleFrame

Implemented by structs that represent a frame of audio samples. A sample frame is a grouping of audio samples from each channel of an output format.

SourceTrait

Capabilities common to both static and streaming sources.

StandardFrame

Implemented for sample frames specified by the base standard.

Type Definitions

AltoResult