9 releases (5 breaking)

0.6.2 Aug 28, 2022
0.6.1 Aug 27, 2022
0.5.0 Jan 3, 2022
0.4.1 Jun 26, 2021
0.1.0 Nov 26, 2020

#85 in Game dev

Download history 54/week @ 2023-06-05 99/week @ 2023-06-12 116/week @ 2023-06-19 74/week @ 2023-06-26 134/week @ 2023-07-03 136/week @ 2023-07-10 246/week @ 2023-07-17 139/week @ 2023-07-24 74/week @ 2023-07-31 119/week @ 2023-08-07 217/week @ 2023-08-14 137/week @ 2023-08-21 59/week @ 2023-08-28 103/week @ 2023-09-04 151/week @ 2023-09-11 72/week @ 2023-09-18

398 downloads per month
Used in 9 crates (4 directly)

MIT/Apache

190KB
3K SLoC

Oddio

Documentation License: Apache 2.0 License: MIT

Oddio is a game-oriented audio library that is:

  • Lightweight: Fast compilation, few dependencies, and a simple interface
  • Sans I/O: Send output wherever you like
  • Real-time: Audio output is efficient and wait-free: no glitches until you run out of CPU
  • 3D: Spatialization with doppler effects and propagation delay available out of the box
  • Extensible: Implement Signal for custom streaming synthesis and filtering
  • Composable: Signals can be transformed without obstructing the inner Signal's controls

Example

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

// In audio callback:
let out_frames = oddio::frame_stereo(data);
oddio::run(&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.control::<oddio::SpatialScene, _>()
    .play(frames, oddio::SpatialOptions { position, velocity, ..Default::default() });

// When position/velocity changes:
handle.control::<oddio::Spatial<_>, _>().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.

Dependencies