#openal #sound #audio #al

alto

Idiomatic interface for OpenAL 1.1 and extensions (including EFX)

32 releases (stable)

3.0.3 Aug 18, 2018
3.0.1 Dec 21, 2017
3.0.0 Jul 30, 2017
2.0.6 Jun 28, 2017
0.1.1 Nov 3, 2016

#9 in Audio

Download history 27/week @ 2018-07-06 54/week @ 2018-07-13 106/week @ 2018-07-20 140/week @ 2018-07-27 81/week @ 2018-08-03 288/week @ 2018-08-10 33/week @ 2018-08-17 70/week @ 2018-08-24 56/week @ 2018-08-31 58/week @ 2018-09-07 82/week @ 2018-09-14 32/week @ 2018-09-21 90/week @ 2018-09-28

522 downloads per month
Used in 2 crates

MIT/Apache

336KB
6.5K SLoC

alto

alto provides idiomatic Rust bindings for OpenAL 1.1 and extensions (including EFX).

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.

API Usage

let alto = Alto::load_default()?;

for s in alto.enumerate_outputs() {
    println!("Found device: {}", s.to_str()?);
}

let device = alto.open(None)?; // Opens the default audio device
let context = device.new_context(None)?; // Creates a default context

// Configure listener
context.set_position([1.0, 4.0, 5.0]);
context.set_velocity([2.5, 0.0, 0.0]);
context.set_orientation(([0.0, 0.0, 1.0], [0.0, 1.0, 0.0]));

let source = context.new_static_source()?;

// Now you can load your samples and store them in a buffer with
// `context.new_buffer(samples, frequency)`;

lib.rs:

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.

Dependencies

~2.5MB
~38K SLoC