mirror of
https://github.com/SFML/SFML.git
synced 2024-12-01 15:51:04 +08:00
Fixed sf::SoundBuffer returning wrong duration for sounds containing more than ~4.3 million samples
This commit is contained in:
parent
db77b76d91
commit
2ff58edd9a
@ -253,7 +253,7 @@ bool SoundBuffer::update(unsigned int channelCount, unsigned int sampleRate)
|
|||||||
alCheck(alBufferData(m_buffer, format, &m_samples[0], size, sampleRate));
|
alCheck(alBufferData(m_buffer, format, &m_samples[0], size, sampleRate));
|
||||||
|
|
||||||
// Compute the duration
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user