Crate rawdio

source ·
Expand description

rawdio is an audio engine that is inspired by the Web Audio API

You can use it to:

  • Create a context
  • Create DSP nodes
  • Connect the nodes together
  • Accurately schedule ‘events’
  • Process the graph with an input and an output

Example

use rawdio::{connect_nodes, create_engine, AudioProcess, Context, Oscillator, OwnedAudioBuffer};

let (mut context, mut process) = create_engine();

let frequency = 1_000.0;
let channel_count = 2;
let oscillator = Oscillator::sine(context.as_ref(), frequency, channel_count);

connect_nodes!(oscillator => "output");

context.start();

// Call `process.process(...)`, passing in the input samples, and using the output
// If you wish to use with your sound card, you could use something like cpal (see the examples)

Modules

  • Module to re-export commonly used types

Macros

Structs

  • An ADSR node that will create an envelope to modulate the amplitude of its input
  • An parameter that generates a value for every audio sample
  • A biquad filter
  • An AudioBuffer that borrows audio from a different audio buffer
  • A basic dynamics compressor
  • A convolution node to convolve the input signal with an impulse response
  • Options to control the engine
  • A node that tracks the input signal and outputs the envelope
  • A node that applies gain to the input
  • A node the connects into the audio graph
  • A level that can be used to convert from linear to decibel representation
  • A node that mixes between its input and output channels
  • A mutable buffer that refers to a portion of another buffer
  • An oscillator node
  • An audio buffer that owns its audio data
  • A node that will pan the input signal between two output channels
  • The context that is passed to every [DspProcessor]
  • A node that records its input
  • Specify the location in an audio buffer using the frame and channel index
  • A node that can play or loop a sample
  • A fixed-point representation of a timestamp
  • A node that will distort the input signal using a specified function

Enums

Traits

  • An AudioBuffer represents floating point audio data for a number of channels
  • An audio process that can be processed with input and output audio samples
  • The root audio context

Functions