Crate alto [] [src]

Overview

Alto is an idiomatic wrapper for the OpenAL 3D audio API and associated extensions (including EFX). This documentation does not describe how to use the OpenAL API itself, but rather explains how it has been adapted for rust and provides the native symbols associated with each function so they can be cross-referenced with the official OpenAL documentation for full details.

The core of the API is the Alto struct. It has no analog in raw OpenAL and represents an implementation of the API itself. From there, instances of familiar OpenAL objects can be instantiated.

WARNING

Because Alto interacts with global C state via dynamic linking, having multiple versions of Alto in one project could lead to unsafetly. Please make sure only one version of Alto is in your dependency tree at any given time.

Modules

efx
ext
sys

Structs

ALawSample
Alto

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

BFormat2D
BFormat3D
Buffer

An audio buffer of any format.

Capture

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

Context

A listener context.

ContextAttrs

Attributes that may be supplied during context creation.

DeferLock

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

Device

A handle to any kind of output device.

LoopbackAttrs

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

LoopbackDevice

A loopback device that outputs audio to a memory buffer. Requires ALC_SOFT_loopback

Mc51Chn
Mc61Chn
Mc71Chn
McQuad
McRear
Mono
MuLawSample
OutputDevice

A regular output device. This is typically a device as reported by the operating system.

StaticSource

A source that can play a shared static buffer.

Stereo
StreamingSource

A source that plays a queue of owned buffers.

Enums

AltoError

An error as reported by alcGetError or alGetError, plus some Alto specific variants.

DistanceModel

The gain curve of sources as a function of distance to the listener.

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. Requires ALC_SOFT_loopback

LoopbackFormatType

Sample format for a loopback context. Requires ALC_SOFT_loopback

SoftHrtfStatus

The current HRTF mode of a device. Requires ALC_SOFT_HRTF

SoftMsadpcmFormat

Formats provided by AL_SOFT_MSADPCM.

SoftSourceSpatialization

The spatialization mode of a source. Requires ALC_SOFT_source_spatialization

SourceState

The current playback state of a source.

StandardFormat

Standard formats defined in the base specification.

Traits

AsBufferData

Implemented for types that represent a shared buffer of audio data.

AsBufferDataMut

Implemented for types that represent a mutable buffer of audio data.

DeviceObject

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.

Source

Capabilities common to both static and streaming sources.

StandardFrame

Implemented for sample frames specified by the base standard.

Type Definitions

AltoResult