14 releases

0.7.4 Oct 15, 2023
0.7.1 Sep 30, 2023
0.6.2 Aug 28, 2022
0.5.0 Jan 3, 2022
0.1.0 Nov 26, 2020

#79 in Game dev

Download history 30/week @ 2023-12-04 38/week @ 2023-12-11 35/week @ 2023-12-18 18/week @ 2023-12-25 11/week @ 2024-01-01 47/week @ 2024-01-08 31/week @ 2024-01-15 23/week @ 2024-01-22 12/week @ 2024-01-29 18/week @ 2024-02-05 37/week @ 2024-02-12 247/week @ 2024-02-19 87/week @ 2024-02-26 38/week @ 2024-03-04 40/week @ 2024-03-11 43/week @ 2024-03-18

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

MIT/Apache

185KB
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, 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.

Dependencies