Expand description
§RS-AUDIO
rs-audio is a Rust library for making retro music programmatically.
Currently, it has support for:
- Sine waves,
- Squares,
- Sawtooths,
- and Triangles.
This library is MIT licensed.
Learn more in our repository: https://github.com/xshotss/rs-audio/blob/main/LICENSE
§Usage:
To create a default song (to make sure everything is working):
use rs_audio::*;
let mut audio_manager = AudioManager::new(); // This creates an audio thread which handles audio.
audio_manager.play(Song::default()); // Plays a default song.
To create custom notes:
use rs_audio::*;
let mut audio_manager = AudioManager::new();
let mut song = Song::new(vec![
Note { freq: 880.0, dur: 1.0, vol: 0.20, wave: WaveForm::Sine },
Note { freq: 220.0, dur: 1.0, vol: 0.20, wave: WaveForm::Square },
Note { freq: 880.0, dur: 1.0, vol: 0.20, wave: WaveForm::Sine },
Note { freq: 220.0, dur: 1.0, vol: 0.20, wave: WaveForm::Triangle },
], BPMChoice::Default);
audio_manager.play(song);§NOTE
This priject has recently moved to a new version. Due to drastic changes, I have started rewriting all documentation.
This should do for now.
Re-exports§
pub use legacyplayer::BasicSong;pub use note::Note;pub use player::AudioManager;pub use player::Song;pub use waveform::WaveForm;pub use BPMChoice::*;
Modules§
Enums§
- BPMChoice
- The BPMChoice is an enum for picking the beats per minute for making songs.
Usage: