{"id":21883466,"url":"https://github.com/laguna1989/openalpp","last_synced_at":"2025-04-15T06:17:36.110Z","repository":{"id":39583014,"uuid":"442449431","full_name":"Laguna1989/OpenALpp","owner":"Laguna1989","description":"Modern OOP C++14 audio library built on OpenAL for Windows, macOS, Linux and web (emscripten).","archived":false,"fork":false,"pushed_at":"2024-11-15T13:57:45.000Z","size":1339,"stargazers_count":6,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T06:17:31.502Z","etag":null,"topics":["audio","audio-library","cpp","cpp14-library","oop","openal","openal-soft"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Laguna1989.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-28T11:59:25.000Z","updated_at":"2024-07-08T15:32:43.000Z","dependencies_parsed_at":"2024-01-23T21:40:51.100Z","dependency_job_id":"62f6397a-e122-42e7-ac72-ee9a13a82cc2","html_url":"https://github.com/Laguna1989/OpenALpp","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laguna1989%2FOpenALpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laguna1989%2FOpenALpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laguna1989%2FOpenALpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Laguna1989%2FOpenALpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Laguna1989","download_url":"https://codeload.github.com/Laguna1989/OpenALpp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016647,"owners_count":21198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio","audio-library","cpp","cpp14-library","oop","openal","openal-soft"],"created_at":"2024-11-28T09:42:15.273Z","updated_at":"2025-04-15T06:17:36.095Z","avatar_url":"https://github.com/Laguna1989.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"OpenALpp\n========\n[![codecov](https://codecov.io/gh/Laguna1989/OpenALpp/branch/master/graph/badge.svg?token=X68KWFTRZG)](https://codecov.io/gh/Laguna1989/OpenALpp)\n[![Tests](https://github.com/Laguna1989/OpenALpp/actions/workflows/test_verification.yml/badge.svg)](https://github.com/Laguna1989/OpenALpp/actions/workflows/test_verification.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nOpenALpp is a modern OOP C++20 audio library built on [OpenAL Soft](https://github.com/kcat/openal-soft)\nfor Windows, macOS, Linux and web (emscripten). It supports loading of wav, mp3, FLAC and ogg files\nvia [libnyquist](https://github.com/ddiakopoulos/libnyquist).\n\nHow to build\n------------\n\n1. `git clone https://github.com/Laguna1989/OpenALpp.git \u0026\u0026 cd OpenALpp`\n2. `mkdir build \u0026\u0026 cd build`\n3. `cmake ..`\n4. `cmake --build . --target OpenALpp_Lib`\n\nHow to measure Code Coverage with [OpenCppCoverage](https://github.com/OpenCppCoverage/OpenCppCoverage)\n-----------\n\n```\nOpenCppCoverage.exe\n    --sources \u003cabsolute path\u003e\\OpenALpp\\impl\\\n    --excluded_sources \u003cabsolute path\u003e\\OpenALpp\\test\\\n    --excluded_sources \u003cabsolute path\u003e\\OpenALpp\\ext*\n    --excluded_sources \u003cabsolute path\u003e\\OpenALpp\\cmake-build-debug*\n    .\\path\\to\\unit_tests\\OpenALpp_UnitTests.exe\n```\n\nCode Example\n----------\n\n```\n#include \"oalpp/sound_context.hpp\"\n#include \"oalpp/sound_data.hpp\"\n#include \"oalpp/sound.hpp\"\n\nusing namespace oalpp;\n\nSoundContext ctx;\nSoundData buffer { \"audio.mp3\" };\nSound snd { buffer };\nsnd.play();\n\nwhile (snd.isPlaying()) {\n    snd.update();\n}\n```\n\nCommon Pitfalls\n------------\n\n* `Sound` has a dependency on `SoundContext`. You need to keep the `SoundContext` alive as long as you want to use\n  sounds.\n    * Note that this does not apply to `SoundData`, which can be created independently of `SoundContext`.\n* Sound has a dependency to the `SoundData` that is passed in the constructor. You need to keep the `SoundData` alive as\n  long as any `Sound` might access it.\n    * You can bundle `SoundData` and `Sound` together in your implementation.\n    * Alternatively you can write your own `SoundDataManager` to avoid creating multiple `SoundData`s for the same file.\n* Your sound will stop after some seconds, even if the audio file contains a longer sound. `Sound`s do not update\n  themselves. You need to call `update()` regularly.\n\nHow to include OpenALpp in your project\n---------------------------------------\n\nCMakeLists.txt\n\n```\nFetchContent_Declare(\n        openalpp\n        GIT_REPOSITORY https://github.com/Laguna1989/OpenALpp.git\n        GIT_TAG master\n)\n\nFetchContent_MakeAvailable(openalpp)\n\nadd_executable(MyProject main.cpp)\ntarget_link_libraries(MyProject OpenALpp_Lib)\n```\n\nCMake Options\n-------------\n\n* `OALPP_ENABLE_UNIT_TESTS` - Enable unit tests - default `ON`\n* `OALPP_ENABLE_APPROVAL_TESTS` - Enable approval tests - default `ON`\n* `OALPP_ENABLE_INTEGRATION_TESTS` - Enable integration test - default `ON`\n* `OALPP_STATIC_LIBRARY` - Build OpenALpp and dependencies as static library - default `ON`\n\nCompiler compatibility\n----------------------\n\n* Microsoft Visual C++ 2019\n* clang++ from version 8\n* g++ from version 9\n* emscripten g++ version 9\n\nDependencies\n------------\n\n* CMake 3.19\n* One of the compatible compilers\n\nAll other dependencies (`openal-soft` and `libnyquist`) are automatically fetched via CMake.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaguna1989%2Fopenalpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaguna1989%2Fopenalpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaguna1989%2Fopenalpp/lists"}