Permalink
Browse files

Fixed sf::SoundBuffer returning wrong duration for sounds containing …

…more than ~4.3 million samples
  • Loading branch information...
LaurentGomila committed Oct 11, 2013
1 parent db77b76 commit 2ff58edd9af5530afa0a58657c0908855c96ce21
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/SFML/Audio/SoundBuffer.cpp
@@ -253,7 +253,7 @@ bool SoundBuffer::update(unsigned int channelCount, unsigned int sampleRate)
alCheck(alBufferData(m_buffer, format, &m_samples[0], size, sampleRate));
// Compute the duration
m_duration = milliseconds(1000 * m_samples.size() / sampleRate / channelCount);
m_duration = seconds(static_cast<float>(m_samples.size()) / sampleRate / channelCount);
return true;
}

0 comments on commit 2ff58ed

Please sign in to comment.