.. index:: pair: class; EE::Audio::tSoundManager .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager: template class EE::Audio::tSoundManager ======================================= .. toctree:: :hidden: struct_EE_Audio_tSoundManager_sSound.rst Overview ~~~~~~~~ A basic template to hold sounds and the respective buffer. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include template class tSoundManager { public: // structs struct :ref:`sSound`; // construction :target:`~tSoundManager`(); // methods bool :ref:`loadFromFile`(const T& id, const std::string& filepath); bool :ref:`loadFromMemory`(const T& id, const char* Data, std::size_t SizeInBytes); bool :ref:`loadFromSamples`(const T& id, const :ref:`Int16`* Samples, std::size_t SamplesCount, unsigned int ChannelCount, unsigned int SampleRate); bool :ref:`loadFromPack`(const T& id, :ref:`Pack`* Pack, const std::string& FilePackPath); :ref:`SoundBuffer`& :ref:`getBuffer`(const T& id); :ref:`Sound`* :ref:`play`(const T& id); bool :ref:`remove`(const T& id); :ref:`Sound`& :ref:`operator[]`(const T& id); :ref:`Sound`& :ref:`getFreeSound`(const T& id); }; .. _details-class_e_e_1_1_audio_1_1t_sound_manager: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A basic template to hold sounds and the respective buffer. Methods ------- .. index:: pair: function; loadFromFile .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a09a526260b46c37a4e251022913f2ba1: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool loadFromFile(const T& id, const std::string& filepath) Load the sound from file. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The sound Id * - filepath - The sound path .. index:: pair: function; loadFromMemory .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a15cea2521e718beb7e0a930e4452bc20: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool loadFromMemory(const T& id, const char* Data, std::size_t SizeInBytes) Load the sound from memory. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The sound id * - Data - The pointer to the data * - SizeInBytes - The size of the file to load .. index:: pair: function; loadFromSamples .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a1fdeba34dd7e30cd6a07a26fe675dd60: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool loadFromSamples(const T& id, const :ref:`Int16`* Samples, std::size_t SamplesCount, unsigned int ChannelCount, unsigned int SampleRate) Load the sound from an array of samples. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The sound id * - Samples - Pointer to the array of samples in memory * - SamplesCount - Number of samples in the array * - ChannelCount - Number of channels (1 = mono, 2 = stereo, ...) * - SampleRate - Sample rate (number of samples to play per second) .. index:: pair: function; loadFromPack .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a936245d1b1d232dfcfef7a776293c193: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool loadFromPack(const T& id, :ref:`Pack`* Pack, const std::string& FilePackPath) Load the sound from a Pack file. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The id to use to identificate the sound * - Pack - The Pack file * - FilePackPath - The pack file path .. index:: pair: function; getBuffer .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a719f6776244645f7fc6c5e5054b0b186: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`SoundBuffer`& getBuffer(const T& id) .. rubric:: Returns: The sound buffer of the sound id .. index:: pair: function; play .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a0608a3439aac943cbdf4450dfe1fba93: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Sound`* play(const T& id) Play the sound. This method will open a new channel if the channel seted for the sound is already playing. \* .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The sound id to play .. index:: pair: function; remove .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a8a3deb52c9bbcce148e67298ab9eb0db: .. ref-code-block:: cpp :class: doxyrest-title-code-block bool remove(const T& id) Remove a sound from the sound manager. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - id - The sound id to remove .. index:: pair: function; operator[] .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a9a28f2800f1b35bcad2482b311c18bab: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Sound`& operator[](const T& id) .. rubric:: Returns: The sound id if exists .. index:: pair: function; getFreeSound .. _doxid-class_e_e_1_1_audio_1_1t_sound_manager_1a08b1c808f2cf1ecb420607baeee01325: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`Sound`& getFreeSound(const T& id) Search for the sound id, and return a sound that is not playing, if all the sounds are playing, creates a new sound. \*. .. rubric:: Returns: The sound