1 stable release
2.0.1 | Sep 13, 2024 |
---|---|
1.0.1 |
|
1.0.0 |
|
#287 in Audio
133 downloads per month
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
- Can be played as
Sound
orMusic
:.wav
,.qoa
,.ogg
,.mp3
,.flac
- Can only be played as
Music
:.xm
Example
- 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();
}
}
- 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.