Crates.io | ez_al |
lib.rs | ez_al |
version | 0.3.1 |
source | src |
created_at | 2023-12-12 21:21:11.510663 |
updated_at | 2024-06-15 04:13:31.719103 |
description | A simple audio library |
homepage | |
repository | https://github.com/skillissuedev/ez_al/ |
max_upload_size | |
id | 1067024 |
size | 12,188 |
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();
Installed cmake and clang
Installation example(Arch Linux): sudo pacman -S clang cmake