#tools #gamedev

bin+lib oml-audio

Very basic, and thin abstraction of audio handling meant for games

13 releases (4 breaking)

Uses new Rust 2021

0.5.1 Jan 13, 2022
0.5.0 Jan 13, 2022
0.4.2 Jan 13, 2022
0.3.0 Jan 12, 2022
0.1.3 Jan 5, 2022

#126 in Game dev

Download history 96/week @ 2022-01-01 156/week @ 2022-01-08 20/week @ 2022-01-15

272 downloads per month

MIT license

580KB
1K SLoC

oml-audio

Work in progress! API will change, but we'll obey semver rules. To be precise:

Pre 1.0.0

  • breaking changes will change the minor version (x.y.0)
  • non-breaking changes will change the patch level (x.y.z)

Post 1.0.0

  • breaking changes will change the major version (x.0.0)
  • non-breaking changes, additions will change the minor version (x.y.0)
  • fixes will change the patch level (x.y.z)

0.y.z will potentially change a lot!

Very thin wrapper for playing music, and audio in rust based games.

Features:

  • Play .mp3 music (with hardware acceleration) on macOS

  • Play .wav & .caf sound on macOS

  • Play .ogg music on windows

  • Play .wav sound on windows

  • Play .ogg music on linux

  • Play .wav sound on linux

Future:

  • Support other platforms (iOS, android, etc)

Example :WIP:

use oml_audio::Audio;
use oml_audio::fileloader::FileLoaderDisk;

pub fn main() {
    let mut fileloader = FileLoaderDisk::new( "./data" ); // 'data' is the base directory for all other files/paths
    fileloader.enable_debug();

    let mut audio = Audio::new();
    audio.load_sound_bank( &mut fileloader, "test.omsb" );

    audio.play_sound( "SOUND_ID" );

    loop {
        let _timestep = audio.update();

        // update
        // render
        // (maybe) yield/sleep
    }

}

Dependencies

~3–4.5MB
~99K SLoC

Wfa