An open API service indexing awesome lists of open source software.

https://github.com/callumc34/audioplusplus

C++ open source audio playback & recording with file support.
https://github.com/callumc34/audioplusplus

audio audio-player cmake cpp library open-source

Last synced: 6 months ago
JSON representation

C++ open source audio playback & recording with file support.

Awesome Lists containing this project

README

          



## About AudioPlusPlus
AudioPlusPlus (A++) is an early development audio playback library designed for easy integration with any programs.

A++ aims to be an easy to use and develop audio library that plugs straight into your program. It does all the interaction between many great open source audio libraries for you.

A++ is currently in very early development stages. Please consider helping by checking out the [roadmap](https://trello.com/b/67YcKpif/audioplusplus).

## How to build
AudioPlusPlus can be built using CMake through the following steps.
1. Clone this repository to your machine using `git clone https://github.com/callumc34/AudioPlusPlus` and move into the directory `cd AudioPlusPlus`
2. Setup the build directory
```bash
mkdir build
cd build
```
3. Install the dependencies for this project:

### Windows
The preferred way to install dependencies on Windows is using [Microsoft's VCPKG](https://github.com/microsoft/vcpkg) manager.

When running the following command, vcpkg will automatically install all the required dependencies.
```bash
cmake .. --toolchain [path to vcpkg]/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=[architecture-platform-static/dynamic(leave blank)]
```

### Linux
For linux the majority of these packages can be installed using the package manager.
```bash
sudo apt install doxygen libasound2-dev libsndfile-dev libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev libmpg123-dev libtag1-dev
```

[PortAudio](https://github.com/portaudio/portaudio) is currently outdated on package manager and thus the most recent version must be manually built and installed.
[SpdLog](https://github.com/gabime/spdlog) currently does not work when installed with package manager and thus must be manually built and installed.

##### Note: These packages may be out of date and not provide full functionality - see alternative for a better option.

### Alternative
Some of the packages installed using the linux package manager may be out of date or lack full functionality.

It is recommended on linux that you manually build both portaudio and sndfile.

The program will output the urls of all the packages so that you can build them yourself.

##### Note: CMake on windows can have trouble finding the installed packages - use the option `-DDEPENDENCIES_ROOT=[Path to install location of dependencies]` to aid CMake in finding them.

4. Build the project
```bash
cmake --build .
cmake --install .
```

## CMake Options - NOTE: Not all functionality is added yet
You can pass additional options with `-D=` when you run
`cmake` command. Some useful system options:
##### Finding dependency options
If you built your own dependencies and installed them using `cmake --install` on windows the best way to let CMake find the packages is with the following variables
- `DEPENDENCIES_ROOT` - Install location of the following packages. On linux if the packages were installed to the default prefix CMake should be able to find them without the need for any variables.

Or specify where to find each package individually
- `FLAC_ROOT` - Install location of FLAC Package
- `LAME_ROOT` - Install location of LAME files with structure `/include` and `/lib`
- `MPG123_ROOT` - Install location of MPG123 Package
- `OGG_ROOT` - Install location of OGG Package
- `OPUS_ROOT` - Install location of OPUS package
- `PORTAUDIO_ROOT` - Install location of PortAudio package
- `SNDFILE_ROOT` - Install location of libsndfile package
- `SPDLOG_ROOT` - Install location of spdlog package
- `Vorbis_ROOT` - Install location of vorbis package
- `TAGLIB_ROOT` - Install location of Taglib package

##### Other options
- `ENABLE_SNDFILE` - Build without using SndFile
- `BUILD_EXAMPLES` - Builds the example programs
- `ENABLE_PACKAGE_CONFIG` - Generate and install [package config file](https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#config-file-packages).
- `INSTALL_PKGCONFIG_MODULE` - Generate and install [pkg-config module](https://people.freedesktop.org/~dbn/pkg-config-guide.html).
- `BUILD_WITH_LOGGING` - Build with logging support (requires SpdLog)
- `CMAKE_INSTALL_PREFIX` - build install location, the same as `--prefix` option
of `configure` script
- `ENABLE_STATIC_RUNTIME` - enable static runtime on Windows platform (MSVC and
MinGW), `OFF` by default.
- `BUILD_DOCUMENTATION` - Builds the doxygen documentation,

## Examples
Check out the examples folder for how to integrate into your app.