Ralith / oddio

Lightweight game audio
Apache License 2.0
146 stars 9 forks source link
audio game-development hacktoberfest rust

Oddio

Documentation License: Apache 2.0 License: MIT

Oddio is a game-oriented audio library that is:

Example

let (mut scene_handle, mut scene) = oddio::SpatialScene::new();

// In audio callback:
let out_frames = oddio::frame_stereo(data);
oddio::run(&mut scene, output_sample_rate, out_frames);

// In game logic:
let frames = oddio::FramesSignal::from(oddio::Frames::from_slice(sample_rate, &frames));
let mut handle = scene_handle
    .play(frames, oddio::SpatialOptions { position, velocity, ..Default::default() });

// When position/velocity changes:
handle.set_motion(position, velocity, false);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.