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

Method LoadFromFile

src/Nazara/Audio/Sound.cpp:145–156  ·  view source on GitHub ↗

! * \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 */

Source from the content-addressed store, hash-verified

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

Callers 14

SkeletalModel.cppFile · 0.45
Billboard.cppFile · 0.45
Model.cppFile · 0.45
Sound.cppFile · 0.45
SoundBuffer.cppFile · 0.45
SoundEmitter.cppFile · 0.45
SpacebattleExampleMethod · 0.45
EnterMethod · 0.45
LogoExampleMethod · 0.45
EnterMethod · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected