Expand description
§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 unsafety. Please make sure only one version of Alto is in your dependency tree at any given time.
Modules§
Structs§
- ALaw
Sample - 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.
- Context
Attrs - Attributes that may be supplied during context creation.
- Defer
Lock - 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.
- Loopback
Attrs - Attributes that may be supplied during context creation from a loopback device.
Requires
ALC_SOFT_loopback
- Loopback
Device - A loopback device that outputs audio to a memory buffer.
Requires
ALC_SOFT_loopback
- Mc51Chn
- Mc61Chn
- Mc71Chn
- McQuad
- McRear
- Mono
- MuLaw
Sample - Output
Device - A regular output device. This is typically a device as reported by the operating system.
- Static
Source - A source that can play a shared static buffer.
- Stereo
- Streaming
Source - A source that plays a queue of owned buffers.
Enums§
- Alto
Error - An error as reported by
alcGetError
oralGetError
, plus some Alto specific variants. - Distance
Model - The gain curve of sources as a function of distance to the listener.
- ExtA
LawFormat - Formats provided by
AL_EXT_ALAW
. - ExtB
Format - Formats provided by
AL_EXT_BFORMAT
. - ExtDouble
Format - Formats provided by
AL_EXT_double
. - ExtFloat32
Format - Formats provided by
AL_EXT_float32
. - ExtIma4
Format - Formats provided by
AL_EXT_IMA4
. - ExtMc
Format - Formats provided by
AL_EXT_MCFORMATS
. - ExtMu
LawB Format - Formats provided by
AL_EXT_MULAW_BFORMAT
. - ExtMu
LawFormat - Formats provided by
AL_EXT_MULAW
. - ExtMu
LawMc Format - Formats provided by
AL_EXT_MULAW_MCFORMATS
. - Format
- Audio formats supported by OpenAL.
- Loopback
Format Channels - Channel format for a loopback context.
Requires
ALC_SOFT_loopback
- Loopback
Format Type - Sample format for a loopback context.
Requires
ALC_SOFT_loopback
- Soft
Hrtf Status - The current HRTF mode of a device.
Requires
ALC_SOFT_HRTF
- Soft
Msadpcm Format - Formats provided by
AL_SOFT_MSADPCM
. - Soft
Source Spatialization - The spatialization mode of a source.
Requires
ALC_SOFT_source_spatialization
- Source
State - The current playback state of a source.
- Standard
Format - Standard formats defined in the base specification.
Traits§
- AsBuffer
Data - Implemented for types that represent a shared buffer of audio data.
- AsBuffer
Data Mut - Implemented for types that represent a mutable buffer of audio data.
- Device
Object - Common capabilities expoed by both real and loopback devices.
- Loopback
Frame - A sample frame that is supported as a loopback device output format.
- Sample
Frame - 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.
- Standard
Frame - Implemented for sample frames specified by the base standard.