Love2D APIDecoderOn this pageDecoder Description: An object which can gradually decode a sound file. type Type: Function. Description: Gets the type of the object as a string. Signature: type: function(self: Decoder): string Returns: Return TypeDescriptionstringThe type as a string. Of Type: Function. Description: Checks whether an object is of a certain type. If the object has the type with the specified name in its hierarchy, this function will return true. Signature: typeOf: function(self: Decoder, type_name: string): boolean Parameters: ParameterTypeDescriptiontype_namestringThe name of the type to check for. Returns: Return TypeDescriptionbooleanTrue if the object is of the specified type, false otherwise. release Type: Function. Description: Destroys the object's Lua reference. The object will be completely deleted if it's not referenced by any other LÖVE object or thread. This method can be used to immediately clean up resources without waiting for Lua's garbage collector. Signature: release: function(self: Decoder): boolean Returns: Return TypeDescriptionbooleanTrue if the object was released by this call, false if it had been previously released. clone Type: Function. Description: Creates a new copy of current decoder. The new decoder will start decoding from the beginning of the audio stream. Signature: clone: function(self: Decoder): Decoder Returns: Return TypeDescriptionDecoderNew copy of the decoder. getChannelCount Type: Function. Description: Returns the number of channels in the stream. Signature: getChannelCount: function(self: Decoder): integer getChannels: function(self: Decoder): integer Returns: Return TypeDescriptioninteger1 for mono, 2 for stereo. getBitDepth Type: Function. Description: Returns the number of bits per sample. Signature: getBitDepth: function(self: Decoder): integer Returns: Return TypeDescriptionintegerEither 8, or 16. getSampleRate Type: Function. Description: Returns the sample rate of the Decoder. Signature: getSampleRate: function(self: Decoder): integer Returns: Return TypeDescriptionintegerNumber of samples per second. getDuration Type: Function. Description: Gets the duration of the sound file. It may not always be sample-accurate, and it may return -1 if the duration cannot be determined at all. Signature: getDuration: function(self: Decoder): number Returns: Return TypeDescriptionnumberThe duration of the sound file in seconds, or -1 if it cannot be determined. decode Type: Function. Description: Decodes the audio and returns a SoundData object containing the decoded audio data. Signature: decode: function(self: Decoder): SoundData | nil Returns: Return TypeDescriptionSoundData or nilDecoded audio data. seek Type: Function. Description: Sets the currently playing position of the Decoder. Signature: seek: function(self: Decoder, offset: number) Parameters: ParameterTypeDescriptionoffsetnumberThe position to seek to, in seconds.