API for Sound:getCapcity

This commit is contained in:
Nevyn Bengtsson 2021-04-15 18:40:54 +02:00 committed by Bjorn
parent 6566423f66
commit 62a2d01daf
1 changed files with 8 additions and 0 deletions

View File

@ -56,6 +56,13 @@ static int l_lovrSoundGetFrameCount(lua_State* L) {
return 1;
}
static int l_lovrSoundGetCapacity(lua_State* L) {
Sound* sound = luax_checktype(L, 1, Sound);
uint32_t frames = lovrSoundGetCapacity(sound);
lua_pushinteger(L, frames);
return 1;
}
static int l_lovrSoundGetSampleCount(lua_State* L) {
Sound* sound = luax_checktype(L, 1, Sound);
uint32_t frames = lovrSoundGetFrameCount(sound);
@ -241,6 +248,7 @@ const luaL_Reg lovrSound[] = {
{ "getChannelCount", l_lovrSoundGetChannelCount },
{ "getSampleRate", l_lovrSoundGetSampleRate },
{ "getFrameCount", l_lovrSoundGetFrameCount },
{ "getCapacity", l_lovrSoundGetCapacity },
{ "getSampleCount", l_lovrSoundGetSampleCount },
{ "getDuration", l_lovrSoundGetDuration },
{ "isCompressed", l_lovrSoundIsCompressed },