Magnum::Audio::AnyImporter class

Any audio importer plugin.

Detects file type based on file extension, loads corresponding plugin and then tries to open the file with it.

This plugin depends on the Audio library and is built if WITH_ANYAUDIOIMPORTER is enabled when building Magnum. To use as a dynamic plugin, you need to load the "AnyAudioImporter" plugin from MAGNUM_PLUGINS_IMPORTER_DIR. To use as a static plugin or as a dependency of another plugin with CMake, you need to request the AnyAudioImporter component of the Magnum package and link to the Magnum::AnyAudioImporter target. See Downloading and building, Usage with CMake and Loading and using plugins for more information.

Supported formats:

  • OGG Vorbis (*.ogg), loaded with any plugin that provides VorbisAudioImporter
  • WAV (*.wav), loaded with WavAudioImporter or any other plugin that provides it
  • FLAC (*.flac), loaded with any plugin that provides FlacAudioImporter

Only loading from files is supported.

Base classes

class AbstractImporter
Base for audio importer plugins.

Constructors, destructors, conversion operators

AnyImporter(PluginManager::Manager<AbstractImporter>& manager) explicit
Constructor with access to plugin manager.
AnyImporter(PluginManager::AbstractManager& manager, const std::string& plugin) explicit
Plugin manager constructor.

Private functions

auto doFeatures() const override -> Features virtual
Implementation for features()
auto doIsOpened() const override -> bool virtual
Implementation for isOpened()
void doClose() override virtual
Implementation for close()
void doOpenFile(const std::string& filename) override virtual
Implementation for openFile()
auto doFormat() const override -> Buffer::Format virtual
Implementation for format()
auto doFrequency() const override -> UnsignedInt virtual
Implementation for frequency()
auto doData() override -> Containers::Array<char> virtual
Implementation for data()

Function documentation

void Magnum::Audio::AnyImporter::doOpenFile(const std::string& filename) override virtual private

Implementation for openFile()

If Feature::OpenData is supported, default implementation opens the file and calls doOpenData() with its contents.