ez_al

Crates.ioez_al
lib.rsez_al
version0.3.1
sourcesrc
created_at2023-12-12 21:21:11.510663
updated_at2024-06-15 04:13:31.719103
descriptionA simple audio library
homepage
repositoryhttps://github.com/skillissuedev/ez_al/
max_upload_size
id1067024
size12,188
skill issue dev (skillissuedev)

documentation

README

A simple audio library

This library makes it easy to play .wav sounds.

// Initializing ez_al
let al = EzAl::new().expect("Failed to open current device or create OpenAL context!");

// Creating an asset
let asset = WavAsset::from_wav(&al, "sound.wav")
  .expect("failed to load a wav file");
    
// Creating sources
let mut pos_source = SoundSource::new(&al, &asset, SoundSourceType::Positional)
  .expect("Failed to create a positional sound source");
    
let mut simple_source = SoundSource::new(&al, &asset, SoundSourceType::Simple)
  .expect("Failed to create a simple sound source");

// Setting listener position and orientation
ez_al::set_listener_transform(&al, cam_pos, cam_at, cam_up);

// Playing sounds
pos_source.play_sound();
simple_source.play_sound();

Prerequirements

Installed cmake and clang

Installation example(Arch Linux): sudo pacman -S clang cmake

Commit count: 24

cargo fmt