Crates.io | audio-processor-standalone |
lib.rs | audio-processor-standalone |
version | 3.5.0 |
source | src |
created_at | 2021-10-30 00:29:14.359195 |
updated_at | 2024-08-26 12:02:19.290415 |
description | Stand-alone Audio/MIDI CLI runner for `audio-processor-traits` |
homepage | https://github.com/yamadapc/augmented-audio |
repository | https://github.com/yamadapc/augmented-audio |
max_upload_size | |
id | 474236 |
size | 631,034 |
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.
audio_processor_main
] and [audio_processor_main_with_midi
]augmented-audio
repositoryThe gist of it is:
AudioProcessor
or SimpleAudioProcessor
from audio_processor_traits
audio_processor_main(processor)
.wav
)A VST may also be generated through the standalone_vst
module and by enabling the vst
feature flag.
Declare the AudioProcessor
:
use audio_processor_traits::{AudioBuffer, AudioContext, 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,
_context: &mut AudioContext,
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);
}
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