///////////////////////////////////////////////////////
| 223 | |
| 224 | //////////////////////////////////////////////////////////// |
| 225 | void 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 | //////////////////////////////////////////////////////////// |
no test coverage detected