MCPcopy Create free account
hub / github.com/SFML/SFML / saveToFile

Method saveToFile

src/SFML/Audio/SoundBuffer.cpp:171–184  ·  view source on GitHub ↗

///////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

169
170////////////////////////////////////////////////////////////
171bool SoundBuffer::saveToFile(const std::filesystem::path& filename) const
172{
173 // Create the sound file in write mode
174 OutputSoundFile file;
175 if (file.openFromFile(filename, getSampleRate(), getChannelCount(), getChannelMap()))
176 {
177 // Write the samples to the opened file
178 file.write(m_samples.data(), m_samples.size());
179
180 return true;
181 }
182
183 return false;
184}
185
186
187////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 2

openFromFileMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected