Magnum::Audio namespace

Audio playback.

Audio import, playback and integration with SceneGraph.

This library depends on the OpenAL library and is built if MAGNUM_WITH_AUDIO is enabled when building Magnum. To use this library with CMake, put FindOpenAL.cmake into your modules/ directory, request the Audio component of the Magnum package and link to the Magnum::Audio target:

find_package(Magnum REQUIRED Audio)

# ...
target_link_libraries(your-app PRIVATE Magnum::Audio)

Additionally, if you're using Magnum as a CMake subproject, bundle the openal-soft repository and do the following before calling find_package() to ensure it's enabled, as the library is not built by default. If you want to use system-installed OpenAL, omit the first part and point CMAKE_PREFIX_PATH to its installation dir if necessary.

set(CMAKE_POSITION_INDEPENDENT_CODE ON) # needed if building dynamic libraries
set(LIBTYPE STATIC) # omit or set to SHARED if you want a shared OpenAL library
add_subdirectory(openal-soft EXCLUDE_FROM_ALL)

set(MAGNUM_WITH_AUDIO ON CACHE BOOL "" FORCE)
add_subdirectory(magnum EXCLUDE_FROM_ALL)

Additional plugins and utilities are built separately. See particular Audio::*Importer class documentation, the magnum-al-info utility documentation, Downloading and building, Downloading and building plugins, Usage with CMake, Plugin usage with CMake and Loading and using plugins for more information.

Namespaces

namespace Extensions
Compile-time information about OpenAL extensions.

Classes

class AbstractImporter
Base for audio importer plugins.
class AnyImporter
Any audio importer plugin.
class Buffer
Sample buffer.
class Context
OpenAL context.
class DrFlacImporter
FLAC audio importer plugin using dr_flac.
class DrMp3Importer new in 2019.10
MP3 audio importer plugin using dr_mp3.
class DrWavImporter
WAV audio importer plugin using dr_wav.
class Extension
Run-time information about OpenAL extension.
class Faad2Importer
AAC audio importer plugin using FAAD2.
template<UnsignedInt dimensions>
class Listener
Listener.
template<UnsignedInt dimensions>
class Playable
Playable.
template<UnsignedInt dimensions>
class PlayableGroup
PlayableGroup.
class Renderer
Global renderer configuration.
class Source
Source.
class StbVorbisImporter
OGG audio importer plugin using stb_vorbis.
class WavImporter
WAV importer plugin.

Enums

enum class ImporterFeature: UnsignedByte { OpenData = 1 << 0 } new in 2020.06
Features supported by an audio importer.
enum class BufferFormat: ALenum { Mono8 = AL_FORMAT_MONO8, Mono16 = AL_FORMAT_MONO16, Stereo8 = AL_FORMAT_STEREO8, Stereo16 = AL_FORMAT_STEREO16, MonoALaw = AL_FORMAT_MONO_ALAW_EXT, StereoALaw = AL_FORMAT_STEREO_ALAW_EXT, MonoMuLaw = AL_FORMAT_MONO_MULAW_EXT, StereoMuLaw = AL_FORMAT_STEREO_MULAW_EXT, MonoFloat = AL_FORMAT_MONO_FLOAT32, StereoFloat = AL_FORMAT_STEREO_FLOAT32, MonoDouble = AL_FORMAT_MONO_DOUBLE_EXT, StereoDouble = AL_FORMAT_STEREO_DOUBLE_EXT, Quad8 = AL_FORMAT_QUAD8, Quad16 = AL_FORMAT_QUAD16, Quad32 = AL_FORMAT_QUAD32, Rear8 = AL_FORMAT_REAR8, Rear16 = AL_FORMAT_REAR16, Rear32 = AL_FORMAT_REAR32, Surround51Channel8 = AL_FORMAT_51CHN8, Surround51Channel16 = AL_FORMAT_51CHN16, Surround51Channel32 = AL_FORMAT_51CHN32, Surround61Channel8 = AL_FORMAT_61CHN8, Surround61Channel16 = AL_FORMAT_61CHN16, Surround61Channel32 = AL_FORMAT_61CHN32, Surround71Channel8 = AL_FORMAT_71CHN8, Surround71Channel16 = AL_FORMAT_71CHN16, Surround71Channel32 = AL_FORMAT_71CHN32 }
Buffer sample format.

Typedefs

using ImporterFeatures = Containers::EnumSet<ImporterFeature> new in 2020.06
Features supported by an audio importer.
using Listener2D = Listener<2>
Listener for two-dimensional float scenes.
using Listener3D = Listener<3>
Listener for three-dimensional float scenes.
using Playable2D = Playable<2>
Playable for two-dimensional float scenes.
using Playable3D = Playable<3>
Playable for three-dimensional float scenes.
using PlayableGroup2D = PlayableGroup<2>
Playable group for two dimensional float scenes.
using PlayableGroup3D = PlayableGroup<3>
Playable group for three dimensional float scenes.

Functions

auto operator<<(Debug& debug, ImporterFeature value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, ImporterFeatures value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, BufferFormat value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, Context::HrtfStatus value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, Renderer::Error value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, Renderer::DistanceModel value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, Source::State value) -> Debug&
Debug output operator.
auto operator<<(Debug& debug, Source::Type value) -> Debug&
Debug output operator.

Enum documentation

enum class Magnum::Audio::ImporterFeature: UnsignedByte new in 2020.06

Features supported by an audio importer.

Enumerators
OpenData

Opening files from raw data using AbstractImporter::openData()

enum class Magnum::Audio::BufferFormat: ALenum

Buffer sample format.

Enumerators
Mono8

8-bit unsigned mono

Mono16

16-bit signed mono

Stereo8

8-bit interleaved unsigned stereo

Stereo16

16-bit interleaved signed stereo

MonoALaw

8-bit mono A-Law Compressed Sound Format

StereoALaw

8-bit interleaved stereo A-Law Compressed Sound Format

MonoMuLaw

8-bit mono μ-Law Compressed Sound Format

StereoMuLaw

8-bit interleaved μ-Law Compressed Sound Format

MonoFloat

32-bit floating-point mono

StereoFloat

32-bit interleaved floating-point stereo

MonoDouble

64-bit floating-point mono

StereoDouble

64-bit interleaved floating-point stereo

Quad8

8-bit unsigned quadrophonic

Quad16

16-bit signed quadrophonic

Quad32

32-bit interleaved floating-point quadrophonic

Rear8

8-bit unsigned rear

Rear16

16-bit signed rear

Rear32

32-bit interleaved floating-point rear

Surround51Channel8

8-bit unsigned 5.1 surround

Surround51Channel16

16-bit signed 5.1 surround

Surround51Channel32

32-bit interleaved floating-point 5.1 surround

Surround61Channel8

8-bit unsigned 6.1 surround

Surround61Channel16

16-bit signed 6.1 surround

Surround61Channel32

32-bit interleaved floating-point 6.1 surround

Surround71Channel8

8-bit unsigned 7.1 surround

Surround71Channel16

16-bit signed 7.1 surround

Surround71Channel32

32-bit interleaved floating-point 7.1 surround

Typedef documentation

typedef Containers::EnumSet<ImporterFeature> Magnum::Audio::ImporterFeatures new in 2020.06

Features supported by an audio importer.

typedef Listener<2> Magnum::Audio::Listener2D

Listener for two-dimensional float scenes.

typedef Listener<3> Magnum::Audio::Listener3D

Listener for three-dimensional float scenes.

typedef Playable<2> Magnum::Audio::Playable2D

Playable for two-dimensional float scenes.

typedef Playable<3> Magnum::Audio::Playable3D

Playable for three-dimensional float scenes.

typedef PlayableGroup<2> Magnum::Audio::PlayableGroup2D

Playable group for two dimensional float scenes.

typedef PlayableGroup<3> Magnum::Audio::PlayableGroup3D

Playable group for three dimensional float scenes.

Function documentation

Debug& Magnum::Audio::operator<<(Debug& debug, ImporterFeature value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, ImporterFeatures value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, BufferFormat value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, Context::HrtfStatus value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, Renderer::Error value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, Renderer::DistanceModel value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, Source::State value)

Debug output operator.

Debug& Magnum::Audio::operator<<(Debug& debug, Source::Type value)

Debug output operator.