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:
darthfodder
2013-03-25 22:04:39 -07:00
parent 275a144907
commit 11dc74c7db
4 changed files with 15 additions and 0 deletions
+5
View File
@@ -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);