#audio-playback #gamedev #music

horizontal_mixer

horizontal mixer in Rust using Kira for audio playback

4 releases

0.1.3 Oct 7, 2023
0.1.2 Oct 7, 2023
0.1.1 Oct 7, 2023
0.1.0 Oct 7, 2023

#418 in Audio

Download history 5/week @ 2024-02-26 64/week @ 2024-04-01

64 downloads per month

MIT license

7KB
117 lines

Rust Horizontal Mixer

Simple horizontal mixer in Rust using Kira for audio playback.

Examples

Mixing between track_1.mp3 and track_2.mp3 with a fade time of 0.15s every 2 seconds, looping

use horizontal_mixer::HorizontalMixer;
use std::{thread, time::Duration};

fn main() {
    let mut horizontal_mixer = HorizontalMixer::new(
        "track_1.mp3",
        "track_2.mp3",
        Duration::from_secs_f32(0.15),
        true,
    );

    horizontal_mixer.play();
    for _ in 0..16 {
        thread::sleep(Duration::from_secs(2));
        horizontal_mixer.toggle_track();
    }
}

License

This project is licensed under the MIT license.
Kira, the library this is based on, is licensed under either:

  • Apache License, Version 2.0
  • MIT License

Dependencies

~3–37MB
~560K SLoC