diff --git a/src/modules/audio/RecordingDevice.h b/src/modules/audio/RecordingDevice.h index 0158c4363..88ab89b04 100644 --- a/src/modules/audio/RecordingDevice.h +++ b/src/modules/audio/RecordingDevice.h @@ -94,7 +94,7 @@ public: /** * @return Number of channels for recording. **/ - virtual int getChannels() const = 0; + virtual int getChannelCount() const = 0; /** * @return True if currently recording. diff --git a/src/modules/audio/Source.h b/src/modules/audio/Source.h index a0ae66117..f0d3052b0 100644 --- a/src/modules/audio/Source.h +++ b/src/modules/audio/Source.h @@ -107,7 +107,7 @@ public: virtual void setAirAbsorptionFactor(float factor) = 0; virtual float getAirAbsorptionFactor() const = 0; - virtual int getChannels() const = 0; + virtual int getChannelCount() const = 0; virtual bool setFilter(const std::map ¶ms) = 0; virtual bool setFilter() = 0; diff --git a/src/modules/audio/null/RecordingDevice.cpp b/src/modules/audio/null/RecordingDevice.cpp index 7d86df957..5deaf3295 100644 --- a/src/modules/audio/null/RecordingDevice.cpp +++ b/src/modules/audio/null/RecordingDevice.cpp @@ -72,7 +72,7 @@ int RecordingDevice::getBitDepth() const return 0; } -int RecordingDevice::getChannels() const +int RecordingDevice::getChannelCount() const { return 0; } diff --git a/src/modules/audio/null/RecordingDevice.h b/src/modules/audio/null/RecordingDevice.h index 9ed7759bb..3f626961a 100644 --- a/src/modules/audio/null/RecordingDevice.h +++ b/src/modules/audio/null/RecordingDevice.h @@ -44,7 +44,7 @@ public: virtual int getSampleCount() const; virtual int getSampleRate() const; virtual int getBitDepth() const; - virtual int getChannels() const; + virtual int getChannelCount() const; virtual bool isRecording() const; private: diff --git a/src/modules/audio/null/Source.cpp b/src/modules/audio/null/Source.cpp index ce2a99dc4..184b6ee2e 100644 --- a/src/modules/audio/null/Source.cpp +++ b/src/modules/audio/null/Source.cpp @@ -224,7 +224,7 @@ float Source::getAirAbsorptionFactor() const return absorptionFactor; } -int Source::getChannels() const +int Source::getChannelCount() const { return 2; } diff --git a/src/modules/audio/null/Source.h b/src/modules/audio/null/Source.h index 20bd464e1..462416303 100644 --- a/src/modules/audio/null/Source.h +++ b/src/modules/audio/null/Source.h @@ -77,7 +77,7 @@ public: virtual float getMaxDistance() const; virtual void setAirAbsorptionFactor(float factor); virtual float getAirAbsorptionFactor() const; - virtual int getChannels() const; + virtual int getChannelCount() const; virtual int getFreeBufferCount() const; virtual bool queue(void *data, size_t length, int dataSampleRate, int dataBitDepth, int dataChannels); diff --git a/src/modules/audio/openal/RecordingDevice.cpp b/src/modules/audio/openal/RecordingDevice.cpp index b68754f6b..247a005b4 100644 --- a/src/modules/audio/openal/RecordingDevice.cpp +++ b/src/modules/audio/openal/RecordingDevice.cpp @@ -132,7 +132,7 @@ int RecordingDevice::getBitDepth() const return bitDepth; } -int RecordingDevice::getChannels() const +int RecordingDevice::getChannelCount() const { return channels; } diff --git a/src/modules/audio/openal/RecordingDevice.h b/src/modules/audio/openal/RecordingDevice.h index 427fd21ab..1de72890a 100644 --- a/src/modules/audio/openal/RecordingDevice.h +++ b/src/modules/audio/openal/RecordingDevice.h @@ -60,7 +60,7 @@ public: virtual int getMaxSamples() const; virtual int getSampleRate() const; virtual int getBitDepth() const; - virtual int getChannels() const; + virtual int getChannelCount() const; virtual bool isRecording() const; private: diff --git a/src/modules/audio/openal/Source.cpp b/src/modules/audio/openal/Source.cpp index cd89cec6f..c08d01dde 100644 --- a/src/modules/audio/openal/Source.cpp +++ b/src/modules/audio/openal/Source.cpp @@ -122,12 +122,12 @@ Source::Source(Pool *pool, love::sound::SoundData *soundData) : love::audio::Source(Source::TYPE_STATIC) , pool(pool) , sampleRate(soundData->getSampleRate()) - , channels(soundData->getChannels()) + , channels(soundData->getChannelCount()) , bitDepth(soundData->getBitDepth()) { - ALenum fmt = Audio::getFormat(soundData->getBitDepth(), soundData->getChannels()); + ALenum fmt = Audio::getFormat(soundData->getBitDepth(), soundData->getChannelCount()); if (fmt == AL_NONE) - throw InvalidFormatException(soundData->getChannels(), soundData->getBitDepth()); + throw InvalidFormatException(soundData->getChannelCount(), soundData->getBitDepth()); staticBuffer.set(new StaticDataBuffer(fmt, soundData->getData(), (ALsizei) soundData->getSize(), sampleRate), Acquire::NORETAIN); @@ -145,13 +145,13 @@ Source::Source(Pool *pool, love::sound::Decoder *decoder) : love::audio::Source(Source::TYPE_STREAM) , pool(pool) , sampleRate(decoder->getSampleRate()) - , channels(decoder->getChannels()) + , channels(decoder->getChannelCount()) , bitDepth(decoder->getBitDepth()) , decoder(decoder) , buffers(DEFAULT_BUFFERS) { - if (Audio::getFormat(decoder->getBitDepth(), decoder->getChannels()) == AL_NONE) - throw InvalidFormatException(decoder->getChannels(), decoder->getBitDepth()); + if (Audio::getFormat(decoder->getBitDepth(), decoder->getChannelCount()) == AL_NONE) + throw InvalidFormatException(decoder->getChannelCount(), decoder->getBitDepth()); for (int i = 0; i < buffers; i++) { @@ -1138,7 +1138,7 @@ int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d) // OpenAL implementations are allowed to ignore 0-size alBufferData calls. if (decoded > 0) { - int fmt = Audio::getFormat(d->getBitDepth(), d->getChannels()); + int fmt = Audio::getFormat(d->getBitDepth(), d->getChannelCount()); if (fmt != AL_NONE) alBufferData(buffer, fmt, d->getBuffer(), decoded, d->getSampleRate()); @@ -1318,7 +1318,7 @@ float Source::getAirAbsorptionFactor() const return absorptionFactor; } -int Source::getChannels() const +int Source::getChannelCount() const { return channels; } diff --git a/src/modules/audio/openal/Source.h b/src/modules/audio/openal/Source.h index ea213587d..3be46490d 100644 --- a/src/modules/audio/openal/Source.h +++ b/src/modules/audio/openal/Source.h @@ -142,7 +142,7 @@ public: virtual float getMaxDistance() const; virtual void setAirAbsorptionFactor(float factor); virtual float getAirAbsorptionFactor() const; - virtual int getChannels() const; + virtual int getChannelCount() const; virtual bool setFilter(const std::map ¶ms); virtual bool setFilter(); diff --git a/src/modules/audio/wrap_RecordingDevice.cpp b/src/modules/audio/wrap_RecordingDevice.cpp index fe86cbd16..9bfd52762 100644 --- a/src/modules/audio/wrap_RecordingDevice.cpp +++ b/src/modules/audio/wrap_RecordingDevice.cpp @@ -39,7 +39,7 @@ int w_RecordingDevice_start(lua_State *L) int samples = d->getMaxSamples(); int samplerate = d->getSampleRate(); int bitdepth = d->getBitDepth(); - int channels = d->getChannels(); + int channels = d->getChannelCount(); if (lua_gettop(L) > 1) { @@ -115,10 +115,10 @@ int w_RecordingDevice_getBitDepth(lua_State *L) return 1; } -int w_RecordingDevice_getChannels(lua_State *L) +int w_RecordingDevice_getChannelCount(lua_State *L) { RecordingDevice *d = luax_checkrecordingdevice(L, 1); - lua_pushnumber(L, d->getChannels()); + lua_pushnumber(L, d->getChannelCount()); return 1; } @@ -144,7 +144,7 @@ static const luaL_Reg w_RecordingDevice_functions[] = { "getSampleCount", w_RecordingDevice_getSampleCount }, { "getSampleRate", w_RecordingDevice_getSampleRate }, { "getBitDepth", w_RecordingDevice_getBitDepth }, - { "getChannels", w_RecordingDevice_getChannels }, + { "getChannelCount", w_RecordingDevice_getChannelCount }, { "getName", w_RecordingDevice_getName }, { "isRecording", w_RecordingDevice_isRecording }, { 0, 0 } diff --git a/src/modules/audio/wrap_Source.cpp b/src/modules/audio/wrap_Source.cpp index 5d2891adf..63e9195d7 100644 --- a/src/modules/audio/wrap_Source.cpp +++ b/src/modules/audio/wrap_Source.cpp @@ -338,10 +338,10 @@ int w_Source_setAirAbsorption(lua_State *L) return 0; } -int w_Source_getChannels(lua_State *L) +int w_Source_getChannelCount(lua_State *L) { Source *t = luax_checksource(L, 1); - lua_pushinteger(L, t->getChannels()); + lua_pushinteger(L, t->getChannelCount()); return 1; } @@ -542,7 +542,7 @@ int w_Source_queue(lua_State *L) luax_catchexcept(L, [&]() { success = t->queue((unsigned char *)s->getData() + offset, length, - s->getSampleRate(), s->getBitDepth(), s->getChannels()); + s->getSampleRate(), s->getBitDepth(), s->getChannelCount()); }); } else if (lua_islightuserdata(L, 2)) @@ -580,6 +580,14 @@ int w_Source_getType(lua_State *L) return 1; } +// Deprecated + +int w_Source_getChannels(lua_State *L) +{ + luax_markdeprecated(L, "Source:getChannels", DEPRECATED_RENAMED, "Source:getChannelCount"); + return w_Source_getChannelCount(L); +} + static const luaL_Reg w_Source_functions[] = { { "clone", w_Source_clone }, @@ -618,7 +626,7 @@ static const luaL_Reg w_Source_functions[] = { "setRolloff", w_Source_setRolloff }, { "getRolloff", w_Source_getRolloff }, - { "getChannels", w_Source_getChannels }, + { "getChannelCount", w_Source_getChannelCount }, { "setFilter", w_Source_setFilter }, { "getFilter", w_Source_getFilter }, @@ -631,6 +639,9 @@ static const luaL_Reg w_Source_functions[] = { "getType", w_Source_getType }, + // Deprecated + { "getChannels", w_Source_getChannels }, + { 0, 0 } }; diff --git a/src/modules/sound/Decoder.h b/src/modules/sound/Decoder.h index b403afac4..b25aa790a 100644 --- a/src/modules/sound/Decoder.h +++ b/src/modules/sound/Decoder.h @@ -123,7 +123,7 @@ public: * Gets the number of channels in a stream. Supported values are 1 (mono) or 2 (stereo). * @return Either 1 for mono, 2 for stereo, or 0 on errors. **/ - virtual int getChannels() const = 0; + virtual int getChannelCount() const = 0; /** * Gets the number of bits per sample. Supported values are 8 or 16. diff --git a/src/modules/sound/SoundData.cpp b/src/modules/sound/SoundData.cpp index c27177afc..f936bb867 100644 --- a/src/modules/sound/SoundData.cpp +++ b/src/modules/sound/SoundData.cpp @@ -83,7 +83,7 @@ SoundData::SoundData(Decoder *decoder) if (data && bufferSize > size) data = (uint8 *) realloc(data, size); - channels = decoder->getChannels(); + channels = decoder->getChannelCount(); bitDepth = decoder->getBitDepth(); sampleRate = decoder->getSampleRate(); } @@ -115,7 +115,7 @@ SoundData::SoundData(const SoundData &c) , bitDepth(0) , channels(0) { - load(c.getSampleCount(), c.getSampleRate(), c.getBitDepth(), c.getChannels(), c.getData()); + load(c.getSampleCount(), c.getSampleRate(), c.getBitDepth(), c.getChannelCount(), c.getData()); } SoundData::~SoundData() @@ -179,7 +179,7 @@ size_t SoundData::getSize() const return size; } -int SoundData::getChannels() const +int SoundData::getChannelCount() const { return channels; } diff --git a/src/modules/sound/SoundData.h b/src/modules/sound/SoundData.h index 2d3bf3137..d5517c66f 100644 --- a/src/modules/sound/SoundData.h +++ b/src/modules/sound/SoundData.h @@ -49,7 +49,7 @@ public: void *getData() const; size_t getSize() const; - virtual int getChannels() const; + virtual int getChannelCount() const; virtual int getBitDepth() const; virtual int getSampleRate() const; virtual int getSampleCount() const; diff --git a/src/modules/sound/lullaby/CoreAudioDecoder.cpp b/src/modules/sound/lullaby/CoreAudioDecoder.cpp index 1b0d119bc..c05a97999 100644 --- a/src/modules/sound/lullaby/CoreAudioDecoder.cpp +++ b/src/modules/sound/lullaby/CoreAudioDecoder.cpp @@ -258,7 +258,7 @@ bool CoreAudioDecoder::isSeekable() return true; } -int CoreAudioDecoder::getChannels() const +int CoreAudioDecoder::getChannelCount() const { return outputInfo.mChannelsPerFrame; } diff --git a/src/modules/sound/lullaby/CoreAudioDecoder.h b/src/modules/sound/lullaby/CoreAudioDecoder.h index 238c8ab37..fb3d2962d 100644 --- a/src/modules/sound/lullaby/CoreAudioDecoder.h +++ b/src/modules/sound/lullaby/CoreAudioDecoder.h @@ -57,7 +57,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; double getDuration(); diff --git a/src/modules/sound/lullaby/FLACDecoder.cpp b/src/modules/sound/lullaby/FLACDecoder.cpp index a4957fce4..c77d687a4 100644 --- a/src/modules/sound/lullaby/FLACDecoder.cpp +++ b/src/modules/sound/lullaby/FLACDecoder.cpp @@ -41,7 +41,7 @@ FLACDecoder::FLACDecoder(Data *data, const std::string &ext, int nbufferSize) process_until_end_of_metadata(); process_single(); seek(0); - bufferSize = 256 * getBitDepth() * getChannels() * 2; + bufferSize = 256 * getBitDepth() * getChannelCount() * 2; delete[](char *) buffer; buffer = new char[bufferSize]; } @@ -93,7 +93,7 @@ bool FLACDecoder::isSeekable() return true; } -int FLACDecoder::getChannels() const +int FLACDecoder::getChannelCount() const { return get_channels(); } diff --git a/src/modules/sound/lullaby/FLACDecoder.h b/src/modules/sound/lullaby/FLACDecoder.h index 960f35301..91e5336b0 100644 --- a/src/modules/sound/lullaby/FLACDecoder.h +++ b/src/modules/sound/lullaby/FLACDecoder.h @@ -49,7 +49,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; int getSampleRate() const; double getDuration(); diff --git a/src/modules/sound/lullaby/GmeDecoder.cpp b/src/modules/sound/lullaby/GmeDecoder.cpp index e45c08055..a58a4d012 100644 --- a/src/modules/sound/lullaby/GmeDecoder.cpp +++ b/src/modules/sound/lullaby/GmeDecoder.cpp @@ -132,7 +132,7 @@ bool GmeDecoder::isSeekable() return true; } -int GmeDecoder::getChannels() const +int GmeDecoder::getChannelCount() const { return 2; } diff --git a/src/modules/sound/lullaby/GmeDecoder.h b/src/modules/sound/lullaby/GmeDecoder.h index 5f70720b2..74b588954 100644 --- a/src/modules/sound/lullaby/GmeDecoder.h +++ b/src/modules/sound/lullaby/GmeDecoder.h @@ -54,7 +54,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; double getDuration(); diff --git a/src/modules/sound/lullaby/ModPlugDecoder.cpp b/src/modules/sound/lullaby/ModPlugDecoder.cpp index 3d6c68817..8923f83a3 100644 --- a/src/modules/sound/lullaby/ModPlugDecoder.cpp +++ b/src/modules/sound/lullaby/ModPlugDecoder.cpp @@ -132,7 +132,7 @@ bool ModPlugDecoder::isSeekable() return true; } -int ModPlugDecoder::getChannels() const +int ModPlugDecoder::getChannelCount() const { return 2; } diff --git a/src/modules/sound/lullaby/ModPlugDecoder.h b/src/modules/sound/lullaby/ModPlugDecoder.h index 1d582321e..50b7db1a9 100644 --- a/src/modules/sound/lullaby/ModPlugDecoder.h +++ b/src/modules/sound/lullaby/ModPlugDecoder.h @@ -57,7 +57,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; double getDuration(); diff --git a/src/modules/sound/lullaby/Mpg123Decoder.cpp b/src/modules/sound/lullaby/Mpg123Decoder.cpp index 802f9e5d6..141d72660 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.cpp +++ b/src/modules/sound/lullaby/Mpg123Decoder.cpp @@ -257,7 +257,7 @@ bool Mpg123Decoder::isSeekable() return true; } -int Mpg123Decoder::getChannels() const +int Mpg123Decoder::getChannelCount() const { return channels; } diff --git a/src/modules/sound/lullaby/Mpg123Decoder.h b/src/modules/sound/lullaby/Mpg123Decoder.h index 72baa5705..0a148bf84 100644 --- a/src/modules/sound/lullaby/Mpg123Decoder.h +++ b/src/modules/sound/lullaby/Mpg123Decoder.h @@ -69,7 +69,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; double getDuration(); diff --git a/src/modules/sound/lullaby/VorbisDecoder.cpp b/src/modules/sound/lullaby/VorbisDecoder.cpp index 7351a0740..a90e4ba4a 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.cpp +++ b/src/modules/sound/lullaby/VorbisDecoder.cpp @@ -250,7 +250,7 @@ bool VorbisDecoder::isSeekable() return (result != 0); } -int VorbisDecoder::getChannels() const +int VorbisDecoder::getChannelCount() const { return vorbisInfo->channels; } diff --git a/src/modules/sound/lullaby/VorbisDecoder.h b/src/modules/sound/lullaby/VorbisDecoder.h index e5e9ba764..e9caff80e 100644 --- a/src/modules/sound/lullaby/VorbisDecoder.h +++ b/src/modules/sound/lullaby/VorbisDecoder.h @@ -60,7 +60,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; int getSampleRate() const; double getDuration(); diff --git a/src/modules/sound/lullaby/WaveDecoder.cpp b/src/modules/sound/lullaby/WaveDecoder.cpp index 823318e56..4af5c60d1 100644 --- a/src/modules/sound/lullaby/WaveDecoder.cpp +++ b/src/modules/sound/lullaby/WaveDecoder.cpp @@ -174,7 +174,7 @@ bool WaveDecoder::isSeekable() return true; } -int WaveDecoder::getChannels() const +int WaveDecoder::getChannelCount() const { return info.channels; } diff --git a/src/modules/sound/lullaby/WaveDecoder.h b/src/modules/sound/lullaby/WaveDecoder.h index b4dd82081..fe7acd6ab 100644 --- a/src/modules/sound/lullaby/WaveDecoder.h +++ b/src/modules/sound/lullaby/WaveDecoder.h @@ -56,7 +56,7 @@ public: bool seek(float s); bool rewind(); bool isSeekable(); - int getChannels() const; + int getChannelCount() const; int getBitDepth() const; int getSampleRate() const; double getDuration(); diff --git a/src/modules/sound/wrap_Decoder.cpp b/src/modules/sound/wrap_Decoder.cpp index c303b53a8..764f05655 100644 --- a/src/modules/sound/wrap_Decoder.cpp +++ b/src/modules/sound/wrap_Decoder.cpp @@ -34,10 +34,10 @@ Decoder *luax_checkdecoder(lua_State *L, int idx) return luax_checktype(L, idx); } -int w_Decoder_getChannels(lua_State *L) +int w_Decoder_getChannelCount(lua_State *L) { Decoder *t = luax_checkdecoder(L, 1); - lua_pushinteger(L, t->getChannels()); + lua_pushinteger(L, t->getChannelCount()); return 1; } @@ -71,8 +71,8 @@ int w_Decoder_decode(lua_State *L) { luax_catchexcept(L, [&]() { SoundData *s = instance()->newSoundData(t->getBuffer(), - decoded / (t->getBitDepth() / 8 * t->getChannels()), - t->getSampleRate(), t->getBitDepth(), t->getChannels()); + decoded / (t->getBitDepth() / 8 * t->getChannelCount()), + t->getSampleRate(), t->getBitDepth(), t->getChannelCount()); luax_pushtype(L, s); s->release(); @@ -96,14 +96,24 @@ int w_Decoder_seek(lua_State *L) return 0; } +int w_Decoder_getChannels(lua_State *L) +{ + luax_markdeprecated(L, "Decoder:getChannels", DEPRECATED_RENAMED, "Decoder:getChannelCount"); + return w_Decoder_getChannelCount(L); +} + static const luaL_Reg w_Decoder_functions[] = { - { "getChannels", w_Decoder_getChannels }, + { "getChannelCount", w_Decoder_getChannelCount }, { "getBitDepth", w_Decoder_getBitDepth }, { "getSampleRate", w_Decoder_getSampleRate }, { "getDuration", w_Decoder_getDuration }, { "decode", w_Decoder_decode }, { "seek", w_Decoder_seek }, + + // Deprecated + { "getChannels", w_Decoder_getChannels }, + { 0, 0 } }; diff --git a/src/modules/sound/wrap_SoundData.cpp b/src/modules/sound/wrap_SoundData.cpp index 9b2d14665..26061441b 100644 --- a/src/modules/sound/wrap_SoundData.cpp +++ b/src/modules/sound/wrap_SoundData.cpp @@ -51,10 +51,10 @@ int w_SoundData_clone(lua_State *L) return 1; } -int w_SoundData_getChannels(lua_State *L) +int w_SoundData_getChannelCount(lua_State *L) { SoundData *t = luax_checksounddata(L, 1); - lua_pushinteger(L, t->getChannels()); + lua_pushinteger(L, t->getChannelCount()); return 1; } @@ -105,16 +105,26 @@ int w_SoundData_getSample(lua_State *L) return 1; } +int w_SoundData_getChannels(lua_State *L) +{ + luax_markdeprecated(L, "SoundData:getChannels", DEPRECATED_RENAMED, "SoundData:getChannelCount"); + return w_SoundData_getChannelCount(L); +} + static const luaL_Reg w_SoundData_functions[] = { { "clone", w_SoundData_clone }, - { "getChannels", w_SoundData_getChannels }, + { "getChannelCount", w_SoundData_getChannelCount }, { "getBitDepth", w_SoundData_getBitDepth }, { "getSampleRate", w_SoundData_getSampleRate }, { "getSampleCount", w_SoundData_getSampleCount }, { "getDuration", w_SoundData_getDuration }, { "setSample", w_SoundData_setSample }, { "getSample", w_SoundData_getSample }, + + // Deprecated + { "getChannels", w_SoundData_getChannels }, + { 0, 0 } }; diff --git a/src/modules/sound/wrap_SoundData.lua b/src/modules/sound/wrap_SoundData.lua index 3267fcfb9..729c97b9c 100644 --- a/src/modules/sound/wrap_SoundData.lua +++ b/src/modules/sound/wrap_SoundData.lua @@ -45,7 +45,7 @@ local typemaxvals = {0x7F, 0x7FFF} local _getBitDepth = SoundData.getBitDepth local _getSampleCount = SoundData.getSampleCount local _getSampleRate = SoundData.getSampleRate -local _getChannels = SoundData.getChannels +local _getChannelCount = SoundData.getChannelCount local _getDuration = SoundData.getDuration local _release = SoundData.release @@ -64,7 +64,7 @@ local objectcache = setmetatable({}, { maxvalue = typemaxvals[bytedepth], samplecount = _getSampleCount(sounddata), samplerate = _getSampleRate(sounddata), - channels = _getChannels(sounddata), + channels = _getChannelCount(sounddata), duration = _getDuration(sounddata), } @@ -131,7 +131,7 @@ function SoundData:getSampleRate() return objectcache[self].samplerate end -function SoundData:getChannels() +function SoundData:getChannelCount() return objectcache[self].channels end