///////////////////////////////////////////////////////
| 175 | |
| 176 | //////////////////////////////////////////////////////////// |
| 177 | void SoundFileReaderWav::seek(std::uint64_t sampleOffset) |
| 178 | { |
| 179 | assert(m_decoder && "wav decoder not initialized. Call SoundFileReaderWav::open() to initialize it."); |
| 180 | |
| 181 | if (const ma_result result = ma_decoder_seek_to_pcm_frame(&*m_decoder, sampleOffset / m_channelCount); |
| 182 | result != MA_SUCCESS) |
| 183 | err() << "Failed to seek wav sound stream: " << ma_result_description(result) << std::endl; |
| 184 | } |
| 185 | |
| 186 | |
| 187 | //////////////////////////////////////////////////////////// |