Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jpernst/alto
Idiomatic Rust bindings for OpenAL 1.1 and extensions (including EFX).
https://github.com/jpernst/alto
Last synced: about 2 months ago
JSON representation
Idiomatic Rust bindings for OpenAL 1.1 and extensions (including EFX).
- Host: GitHub
- URL: https://github.com/jpernst/alto
- Owner: jpernst
- License: apache-2.0
- Archived: true
- Created: 2012-11-28T02:56:35.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2020-03-01T13:49:00.000Z (almost 5 years ago)
- Last Synced: 2024-08-11T17:08:13.215Z (4 months ago)
- Language: Rust
- Homepage:
- Size: 1.32 MB
- Stars: 80
- Watchers: 3
- Forks: 28
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-rust-cn - jpernst/alto - ci.org/jpernst/alto.svg?branch=master">](https://travis-ci.org/jpernst/alto) (Libraries / Audio)
- awesome-rust - jpernst/alto - ci.org/jpernst/alto.svg?branch=master">](https://travis-ci.org/jpernst/alto) (Libraries / Audio)
- awesome-rust-zh - jpernst/alto - OpenAL 1.1 绑定 [<img src="https://api.travis-ci.org/jpernst/alto.svg?branch=master">](https://travis-ci.org/jpernst/alto) (库 / 音频)
- awesome-rust - jpernst/alto - ci.org/jpernst/alto.svg?branch=master">](https://travis-ci.org/jpernst/alto) (库 Libraries / 音频 Audio)
- awesome-rust-zh-cn - jpernst/alto - 1.1及扩展(包括EFX)的Rust语言绑定。[<img src="https://api.travis-ci.org/jpernst/alto.svg?branch=master">](https://travis-ci.org/jpernst/alto) (音频(Audio) / 天文(Astronomy))
README
# alto
`alto` provides idiomatic Rust bindings for [OpenAL 1.1](http://connect.creativelabs.com/openal/)
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
```rust
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)`;
```