///////////////////////////////////////////////////////
| 243 | |
| 244 | //////////////////////////////////////////////////////////// |
| 245 | bool SoundBuffer::initialize(InputSoundFile& file) |
| 246 | { |
| 247 | // Retrieve the sound parameters |
| 248 | const std::uint64_t sampleCount = file.getSampleCount(); |
| 249 | |
| 250 | // Read the samples from the provided file |
| 251 | m_samples.resize(static_cast<std::size_t>(sampleCount)); |
| 252 | if (file.read(m_samples.data(), sampleCount) == sampleCount) |
| 253 | { |
| 254 | // Update the internal buffer with the new samples |
| 255 | if (!update(file.getChannelCount(), file.getSampleRate(), file.getChannelMap())) |
| 256 | { |
| 257 | err() << "Failed to initialize sound buffer (internal update failure)" << std::endl; |
| 258 | return false; |
| 259 | } |
| 260 | |
| 261 | return true; |
| 262 | } |
| 263 | |
| 264 | return false; |
| 265 | } |
| 266 | |
| 267 | |
| 268 | //////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected