mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Add SoundData:getDuration, returns the duration in seconds
This commit is contained in:
@@ -147,6 +147,11 @@ int SoundData::getSampleRate() const
|
||||
return sampleRate;
|
||||
}
|
||||
|
||||
int SoundData::getDuration() const
|
||||
{
|
||||
return size/(channels*sampleRate*bits/8);
|
||||
}
|
||||
|
||||
void SoundData::setSample(int i, float sample)
|
||||
{
|
||||
// Check range.
|
||||
|
||||
Reference in New Issue
Block a user