34#include <unordered_map>
153 template <
typename T>
154 using CreateFnPtr = std::unique_ptr<T> (*)();
157 using WriterCheckFnPtr = bool (*)(
const std::filesystem::path&);
159 using ReaderFactoryMap = std::unordered_map<CreateFnPtr<SoundFileReader>, ReaderCheckFnPtr>;
160 using WriterFactoryMap = std::unordered_map<CreateFnPtr<SoundFileWriter>, WriterCheckFnPtr>;
165 [[nodiscard]]
static ReaderFactoryMap& getReaderFactoryMap();
166 [[nodiscard]]
static WriterFactoryMap& getWriterFactoryMap();
171#include <SFML/Audio/SoundFileFactory.inl>
Manages and instantiates sound file readers and writers.
static void unregisterWriter()
Unregister a writer.
static std::unique_ptr< SoundFileReader > createReaderFromFilename(const std::filesystem::path &filename)
Instantiate the right reader for the given file on disk.
static std::unique_ptr< SoundFileWriter > createWriterFromFilename(const std::filesystem::path &filename)
Instantiate the right writer for the given file on disk.
static std::unique_ptr< SoundFileReader > createReaderFromStream(InputStream &stream)
Instantiate the right codec for the given file in stream.
static std::unique_ptr< SoundFileReader > createReaderFromMemory(const void *data, std::size_t sizeInBytes)
Instantiate the right codec for the given file in memory.
static void registerWriter()
Register a new writer.
static void unregisterReader()
Unregister a reader.
static void registerReader()
Register a new reader.
static bool isReaderRegistered()
Check if a reader is registered.
static bool isWriterRegistered()
Check if a writer is registered.
Abstract base class for sound file decoding.
Abstract base class for sound file encoding.