radio-rs

Crates.ioradio-rs
lib.rsradio-rs
version2.0.2
sourcesrc
created_at2024-09-12 16:26:35.29186
updated_at2024-10-26 11:35:27.782677
descriptionA very simple, high level, audio playback library, ported from raudio library, for games.
homepage
repositoryhttps://github.com/AnkurMal/radio
max_upload_size
id1372899
size1,132,235
Ankur Mallick (AnkurMal)

documentation

README

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("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("music.mp3");

    music.play();
    loop {
        clear_background(LIGHTGRAY);
        music.update();
        audio_device.sync();
        
        next_frame().await
    }
}
Commit count: 23

cargo fmt