.. index:: pair: class; EE::Audio::SoundFileFactory .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory: class EE::Audio::SoundFileFactory ================================= .. toctree:: :hidden: struct_EE_Audio_SoundFileFactory_ReaderFactory.rst struct_EE_Audio_SoundFileFactory_WriterFactory.rst Overview ~~~~~~~~ Manages and instantiates sound file readers and writers. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class SoundFileFactory { public: // structs struct :ref:`ReaderFactory`; struct :ref:`WriterFactory`; // methods template static void :ref:`registerReader`(); template static void :ref:`unregisterReader`(); template static void :ref:`registerWriter`(); template static void :ref:`unregisterWriter`(); static :ref:`SoundFileReader`* :ref:`createReaderFromFilename`(const std::string& filename); static :ref:`SoundFileReader`* :ref:`createReaderFromMemory`(const void* data, std::size_t sizeInBytes); static :ref:`SoundFileReader`* :ref:`createReaderFromStream`(:ref:`IOStream`& stream); static :ref:`SoundFileWriter`* :ref:`createWriterFromFilename`(const std::string& filename); }; .. _details-class_e_e_1_1_audio_1_1_sound_file_factory: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Manages and instantiates sound file readers and writers. This class is where all the sound file readers and writers are registered. You should normally only need to use its registration and unregistration functions; readers/writers creation and manipulation are wrapped into the higher-level classes :ref:`InputSoundFile ` and :ref:`OutputSoundFile `. To register a new reader (writer) use the :ref:`SoundFileFactory::registerReader ` (registerWriter) static function. You don't have to call the unregisterReader (unregisterWriter) function, unless you want to unregister a format before your application ends (typically, when a plugin is unloaded). Usage example: .. ref-code-block:: cpp SoundFileFactory::registerReader(); SoundFileFactory::registerWriter(); .. rubric:: See also: :ref:`InputSoundFile `, :ref:`OutputSoundFile `, :ref:`SoundFileReader `, :ref:`SoundFileWriter ` Methods ------- .. index:: pair: function; registerReader .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1ab86077f1a0fcc023cb8f29b310c9dd75: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static void registerReader() Register a new reader. .. rubric:: See also: :ref:`unregisterReader ` .. index:: pair: function; unregisterReader .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1a22835b2725e5144f86883e81c4437819: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static void unregisterReader() Unregister a reader. .. rubric:: See also: :ref:`registerReader ` .. index:: pair: function; registerWriter .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1a606bbe123c0db9137cc44bb3a0c773ce: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static void registerWriter() Register a new writer. .. rubric:: See also: :ref:`unregisterWriter ` .. index:: pair: function; unregisterWriter .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1a3eee4321b19d92401e4b77fca53fa4f9: .. ref-code-block:: cpp :class: doxyrest-title-code-block template static void unregisterWriter() Unregister a writer. .. rubric:: See also: :ref:`registerWriter ` .. index:: pair: function; createReaderFromFilename .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1aaafd240a5b1215c83e239095f4364ce0: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`SoundFileReader`* createReaderFromFilename(const std::string& filename) Instantiate the right reader for the given file on disk. It's up to the caller to release the returned reader .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - filename - Path of the sound file .. rubric:: Returns: A new sound file reader that can read the given file, or null if no reader can handle it .. rubric:: See also: :ref:`createReaderFromMemory `, :ref:`createReaderFromStream ` .. index:: pair: function; createReaderFromMemory .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1a4a60b503e7e94a8a98b8fd9a79200f49: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`SoundFileReader`* createReaderFromMemory(const void* data, std::size_t sizeInBytes) Instantiate the right codec for the given file in memory. It's up to the caller to release the returned reader .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - data - Pointer to the file data in memory * - sizeInBytes - Total size of the file data, in bytes .. rubric:: Returns: A new sound file codec that can read the given file, or null if no codec can handle it .. rubric:: See also: :ref:`createReaderFromFilename `, :ref:`createReaderFromStream ` .. index:: pair: function; createReaderFromStream .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1af0795d22d84b39a430c122251ec21981: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`SoundFileReader`* createReaderFromStream(:ref:`IOStream`& stream) Instantiate the right codec for the given file in stream. It's up to the caller to release the returned reader .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - stream - Source stream to read from .. rubric:: Returns: A new sound file codec that can read the given file, or null if no codec can handle it .. rubric:: See also: :ref:`createReaderFromFilename `, :ref:`createReaderFromMemory ` .. index:: pair: function; createWriterFromFilename .. _doxid-class_e_e_1_1_audio_1_1_sound_file_factory_1ac6a8c3325eaed5042c84127317f3236d: .. ref-code-block:: cpp :class: doxyrest-title-code-block static :ref:`SoundFileWriter`* createWriterFromFilename(const std::string& filename) Instantiate the right writer for the given file on disk. It's up to the caller to release the returned writer .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - filename - Path of the sound file .. rubric:: Returns: A new sound file writer that can write given file, or null if no writer can handle it