MCPcopy Index your code
hub / github.com/Ralith/oddio

github.com/Ralith/oddio @v0.7.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.4 ↗ · + Follow
278 symbols 647 edges 30 files 96 documented · 35%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

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.

Extension points exported contracts — how you extend this code

Signal (Interface)
An audio signal This interface is intended for use only from the code actually generating an audio signal for output. F [20 …
src/signal.rs
Frame (Interface)
A single frame of audio data, encoding one sample for each channel [2 implementers]
src/frame.rs
Float (Interface)
(no doc) [4 implementers]
src/math/mod.rs
Interpolate (Interface)
Types that can be linearly interpolated, for use with [`Smoothed`] [1 implementers]
src/smooth.rs
Seek (Interface)
Audio signals which support seeking Should only be implemented for signals which are defined deterministically in terms [11 …
src/signal.rs

Core symbols most depended-on inside this repo

len
called by 59
src/spsc.rs
get
called by 13
src/smooth.rs
sqrt
called by 12
src/math/std.rs
sample
called by 11
src/cycle.rs
write
called by 10
src/ring.rs
update
called by 10
src/set.rs
play
called by 9
src/mixer.rs
received
called by 8
src/swap.rs

Shape

Method 156
Function 61
Class 53
Interface 5
Enum 3

Languages

Rust100%

Modules by API surface

src/spsc.rs28 symbols
src/spatial.rs28 symbols
src/frames.rs21 symbols
src/set.rs17 symbols
src/math/mod.rs14 symbols
src/stream.rs13 symbols
src/math/std.rs12 symbols
src/math/libm.rs12 symbols
src/gain.rs12 symbols
src/mixer.rs11 symbols
src/signal.rs10 symbols
src/cycle.rs10 symbols

For agents

$ claude mcp add oddio \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact