Loading repository data…
Loading repository data…
Laguna1989 / repository
Modern OOP C++14 audio library built on OpenAL for Windows, macOS, Linux and web (emscripten).
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
OpenALpp is a modern OOP C++20 audio library built on OpenAL Soft for Windows, macOS, Linux and web (emscripten). It supports loading of wav, mp3, FLAC and ogg files via libnyquist.
git clone https://github.com/Laguna1989/OpenALpp.git && cd OpenALppmkdir build && cd buildcmake ..cmake --build . --target OpenALpp_LibOpenCppCoverage.exe
--sources <absolute path>\OpenALpp\impl\
--excluded_sources <absolute path>\OpenALpp\test\
--excluded_sources <absolute path>\OpenALpp\ext*
--excluded_sources <absolute path>\OpenALpp\cmake-build-debug*
.\path\to\unit_tests\OpenALpp_UnitTests.exe
#include "oalpp/sound_context.hpp"
#include "oalpp/sound_data.hpp"
#include "oalpp/sound.hpp"
using namespace oalpp;
SoundContext ctx;
SoundData buffer { "audio.mp3" };
Sound snd { buffer };
snd.play();
while (snd.isPlaying()) {
snd.update();
}
Sound has a dependency on SoundContext. You need to keep the SoundContext alive as long as you want to use
sounds.
SoundData, which can be created independently of SoundContext.SoundData that is passed in the constructor. You need to keep the SoundData alive as
long as any Sound might access it.
SoundData and Sound together in your implementation.SoundDataManager to avoid creating multiple SoundDatas for the same file.Sounds do not update
themselves. You need to call update() regularly.CMakeLists.txt
FetchContent_Declare(
openalpp
GIT_REPOSITORY https://github.com/Laguna1989/OpenALpp.git
GIT_TAG master
)
FetchContent_MakeAvailable(openalpp)
add_executable(MyProject main.cpp)
target_link_libraries(MyProject OpenALpp_Lib)
OALPP_ENABLE_UNIT_TESTS - Enable unit tests - default ONOALPP_ENABLE_APPROVAL_TESTS - Enable approval tests - default ONOALPP_ENABLE_INTEGRATION_TESTS - Enable integration test - default ONOALPP_STATIC_LIBRARY - Build OpenALpp and dependencies as static library - default ONAll other dependencies (openal-soft and libnyquist) are automatically fetched via CMake.