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

Method getTimeOffset

src/SFML/Audio/InputSoundFile.cpp:261–269  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

259
260////////////////////////////////////////////////////////////
261Time InputSoundFile::getTimeOffset() const
262{
263 // Make sure we don't divide by 0
264 if (m_channelMap.empty() || m_sampleRate == 0)
265 return Time::Zero;
266
267 return seconds(
268 static_cast<float>(m_sampleOffset) / static_cast<float>(m_channelMap.size()) / static_cast<float>(m_sampleRate));
269}
270
271
272////////////////////////////////////////////////////////////

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected