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

Method write

src/SFML/Audio/SoundFileWriterWav.cpp:225–241  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

223
224////////////////////////////////////////////////////////////
225void SoundFileWriterWav::write(const std::int16_t* samples, std::uint64_t count)
226{
227 assert(m_file.good() && "Most recent I/O operation failed");
228 assert(count % m_channelCount == 0);
229
230 if (count % m_channelCount != 0)
231 err() << "Writing samples to WAV sound file requires writing full frames at a time" << std::endl;
232
233 while (count >= m_channelCount)
234 {
235 for (auto i = 0u; i < m_channelCount; ++i)
236 encode(m_file, samples[m_remapTable[i]]);
237
238 samples += m_channelCount;
239 count -= m_channelCount;
240 }
241}
242
243
244////////////////////////////////////////////////////////////

Callers 2

encodeFunction · 0.45
writeHeaderMethod · 0.45

Calls 1

encodeFunction · 0.70

Tested by

no test coverage detected