! * \brief Loads the sound from file * \return true if loading is successful * * \param filePath Path to the file * \param params Parameters for the sound * * \remark Produces a NazaraError if loading failed */
| 143 | * \remark Produces a NazaraError if loading failed |
| 144 | */ |
| 145 | bool Sound::LoadFromFile(const String& filePath, const SoundBufferParams& params) |
| 146 | { |
| 147 | SoundBufferRef buffer = SoundBuffer::New(); |
| 148 | if (!buffer->LoadFromFile(filePath, params)) |
| 149 | { |
| 150 | NazaraError("Failed to load buffer from file (" + filePath + ')'); |
| 151 | return false; |
| 152 | } |
| 153 | |
| 154 | SetBuffer(buffer); |
| 155 | return true; |
| 156 | } |
| 157 | |
| 158 | /*! |
| 159 | * \brief Loads the sound from memory |
no outgoing calls
no test coverage detected