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

Method read

src/SFML/Audio/SoundFileReaderWav.cpp:188–199  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

186
187////////////////////////////////////////////////////////////
188std::uint64_t SoundFileReaderWav::read(std::int16_t* samples, std::uint64_t maxCount)
189{
190 assert(m_decoder && "wav decoder not initialized. Call SoundFileReaderWav::open() to initialize it.");
191
192 std::uint64_t framesRead{};
193
194 if (const ma_result result = ma_decoder_read_pcm_frames(&*m_decoder, samples, maxCount / m_channelCount, &framesRead);
195 result != MA_SUCCESS)
196 err() << "Failed to read from wav sound stream: " << ma_result_description(result) << std::endl;
197
198 return framesRead * m_channelCount;
199}
200
201} // namespace sf::priv

Callers 1

onReadFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected