#audio-playback #sound #music #high-level #ported #format #raudio

radio-rs

A very simple, high level, audio playback library, ported from raudio library, for games

1 stable release

2.0.1 Sep 13, 2024
1.0.1 Sep 13, 2024
1.0.0 Sep 12, 2024

#287 in Audio

Download history 263/week @ 2024-09-08 83/week @ 2024-09-15 5/week @ 2024-09-22 7/week @ 2024-09-29 2/week @ 2024-10-06

133 downloads per month

MIT license

1MB
278 lines

Contains (static library, 1MB) libaudio.a

A very simple, high level, audio playback library, ported from raudio library, for games.

Supported audio formats

  1. Can be played as Sound or Music: .wav, .qoa, .ogg, .mp3, .flac
  2. Can only be played as Music: .xm

Example

  1. Example code of it being used in a standalone manner:
use radio_rs::*;

fn main() {
    let mut audio_device = AudioDevice::new();
    let music = Music::load(&audio_device, "music.mp3");

    music.play();
    loop {
        music.update();
        audio_device.sync();
    }
}
  1. Example code of it being used with macroquad:
use radio_rs::*;
use macroquad::prelude::*;

#[macroquad::main("sample")]
async fn main() {
    let audio_device = AudioDevice::new();
    let music = Music::load(&audio_device, "music.mp3");

    music.play();
    loop {
        clear_background(LIGHTGRAY);
        music.update();
        
        next_frame().await
    }
}

NOTE: Here audio_device.sync() is not used because next_frame().await waits for the for the next frame anyway.

No runtime deps