mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Add SoundData:getSampleCount() function
Adds SoundData:getSampleCount(), calculates how many samples there are in this particular SoundData. resolves #578 --HG-- branch : sounddata-samplecount
This commit is contained in:
@@ -147,6 +147,11 @@ int SoundData::getSampleRate() const
|
||||
return sampleRate;
|
||||
}
|
||||
|
||||
int SoundData::getSampleCount() const
|
||||
{
|
||||
return (size/channels)/(bits/8);
|
||||
}
|
||||
|
||||
int SoundData::getDuration() const
|
||||
{
|
||||
return size/(channels*sampleRate*bits/8);
|
||||
|
||||
Reference in New Issue
Block a user