#audio #vst-plugin #user-interface #processor #web #standalone #ui #cli

audio-processor-standalone

Stand-alone Audio/MIDI CLI runner for audio-processor-traits

15 releases (3 stable)

new 1.3.0 Sep 29, 2022
1.2.0 Sep 29, 2022
1.0.0-alpha.12 May 25, 2022
1.0.0-alpha.9 Apr 7, 2022
0.1.5 Oct 30, 2021

#357 in Audio

Download history 10/week @ 2022-06-12 9/week @ 2022-06-19 7/week @ 2022-06-26 38/week @ 2022-07-03 38/week @ 2022-07-10 16/week @ 2022-07-17 28/week @ 2022-07-24 7/week @ 2022-07-31 29/week @ 2022-08-07 7/week @ 2022-08-14 39/week @ 2022-08-21 5/week @ 2022-08-28 68/week @ 2022-09-04 37/week @ 2022-09-11 30/week @ 2022-09-18 69/week @ 2022-09-25

207 downloads per month
Used in fewer than 6 crates

MIT license

450KB
5K SLoC

audio-processor-standalone

Augmented Audio: Audio Processor Standalone

crates.io docs.rs


This is part of https://github.com/yamadapc/augmented-audio. Please review its goals. This crate builds upon audio_processor_traits::AudioProcessor.

Provides a stand-alone audio-processor runner for AudioProcessor implementations.

Navigating the documentation

  • Look at exported functions & macros; the structs/traits are for more advanced/internal usage.
  • Start with [audio_processor_main] and [audio_processor_main_with_midi]
  • There are plenty examples in the augmented-audio repository

The gist of it is:

  1. Implement AudioProcessor or SimpleAudioProcessor from audio_processor_traits
  2. Call audio_processor_main(processor)
  3. You now have a CLI for rendering online (CPAL, use your mic) or offline (pass a file through your processor & write the results to a .wav)

A VST may also be generated through the standalone_vst module and by enabling the vst feature flag.

Example usage

Declare the AudioProcessor:

use audio_processor_traits::{AudioBuffer, AudioProcessor};

struct GainProcessor {}

impl GainProcessor { fn new() -> Self { GainProcessor {} }}

impl AudioProcessor for GainProcessor {
    type SampleType = f32;
    fn process<BufferType: AudioBuffer<SampleType=Self::SampleType>>(&mut self, data: &mut BufferType) {
        for sample in data.slice_mut() {
           *sample = *sample * 0.4;
        }
    }
}

Declare the main function:

fn main() {
    let processor = GainProcessor::new();
    audio_processor_standalone::audio_processor_main(processor);
}

Usage of the command-line

audio-processor-standalone

USAGE:
my-crate [OPTIONS]

FLAGS:
-h, --help       Prints help information
-V, --version    Prints version information

OPTIONS:
-i, --input-file <INPUT_PATH>              An input audio file to process
--midi-input-file <MIDI_INPUT_FILE>    If specified, this MIDI file will be passed through the processor
-o, --output-file <OUTPUT_PATH>            If specified, will render offline into this file (WAV)

License: MIT

Dependencies

~15–54MB
~1M SLoC