MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / LoadFromMemory

Method LoadFromMemory

src/Nazara/Audio/Sound.cpp:168–179  ·  view source on GitHub ↗

! * \brief Loads the sound from memory * \return true if loading is successful * * \param data Raw memory * \param size Size of the memory * \param params Parameters for the sound * * \remark Produces a NazaraError if loading failed */

Source from the content-addressed store, hash-verified

166 * \remark Produces a NazaraError if loading failed
167 */
168 bool Sound::LoadFromMemory(const void* data, std::size_t size, const SoundBufferParams& params)
169 {
170 SoundBufferRef buffer = SoundBuffer::New();
171 if (!buffer->LoadFromMemory(data, size, params))
172 {
173 NazaraError("Failed to load buffer from memory (" + String::Pointer(data) + ')');
174 return false;
175 }
176
177 SetBuffer(buffer);
178 return true;
179 }
180
181 /*!
182 * \brief Loads the sound from stream

Callers 1

CheckboxWidget.cppFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected