///////////////////////////////////////////////////////
| 176 | |
| 177 | //////////////////////////////////////////////////////////// |
| 178 | std::uint64_t SoundFileReaderMp3::read(std::int16_t* samples, std::uint64_t maxCount) |
| 179 | { |
| 180 | // dr_mp3's PCM frame contains one sample per channel |
| 181 | std::uint64_t toRead = std::min(maxCount, m_numSamples - m_position) / m_decoder.channels; |
| 182 | toRead = std::uint64_t{drmp3_read_pcm_frames_s16(&m_decoder, toRead, samples)} * m_decoder.channels; |
| 183 | m_position += toRead; |
| 184 | return toRead; |
| 185 | } |
| 186 | |
| 187 | } // namespace sf::priv |
no outgoing calls
no test coverage detected