https://github.com/hezaerd/hezaudio
Hezaerd's audio Library
https://github.com/hezaerd/hezaudio
library openal-soft sound
Last synced: 3 months ago
JSON representation
Hezaerd's audio Library
- Host: GitHub
- URL: https://github.com/hezaerd/hezaudio
- Owner: Hezaerd
- License: apache-2.0
- Created: 2023-09-22T07:57:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-25T11:44:55.000Z (over 1 year ago)
- Last Synced: 2025-01-04T02:29:06.187Z (5 months ago)
- Topics: library, openal-soft, sound
- Language: C++
- Homepage:
- Size: 7.19 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# HezAudio
Hezaerd Audio is an audio library wich take place in my collection of [libraries](https://github.com/stars/Hezaerd/lists/hezaerd-s-libraries) that I made for my own projects , built on top of [OpenAL Soft](https://openal-soft.org/). I've never written an audio library before so I figured I'd give it a shot, since I want a library that's easy to use and has a simple API. I'm not sure if I'll ever finish it, but I'll try my best.
### Build status
## Currently support
- Formats : `.ogg` & `.mp3`
- 3D spatial playback## TODO
- [ ] Add support for more formats (`.wav` in priority)
- [ ] Unload audio sources from memory
- [ ] Stream audio files (for working play/pause/stop)
- [ ] Listener positioning API
- [ ] Effects ??## Exemple
Check out the [demo](https://github.com/Hezaerd/HezAudio/tree/main/HezAudio-Demo) project for more, but it's super simple to use.```cpp
// Init the audio engine - bool is for debug mode
Hez::Audio::Audio::Init(true);
// Load audio source from file - bool is for whether the
// source should be in 3D space or not
auto source = Hez::Audio::Audio::LoadAudioSource("Assets/effect.ogg", true);
// Play the audio source
Hez::Audio::Audio::Play(source);
```
and you can set various properties on the audio source as well:
```cpp
source.SetPosition(x, y, z);
source.SetGain(2.0f);
source.SetPitch(1.2f);
source.SetLooping(true);
```## Dependencies
- [OpenAL Soft](https://openal-soft.org/)
- [minimp3](https://github.com/lieff/minimp3)
- [libogg & Vorbis](https://xiph.org/)