Nocare3/love2dapi_chunks huggingface dataset:
Source:getAttenuationDistances
Gets the reference and maximum attenuation distances of the Source. The values, combined with the current DistanceModel, affect how the Source's volume attenuates based on distance from the listener.
ref, max = Source:getAttenuationDistances()
ref number The current reference attenuation distance. If the current DistanceModel is clamped, this is the minimum distance before the Source is no longer attenuated.
max number The current maximum attenuation distance.
Source:getChannelCount
Gets the number of channels in the Source. Only 1-channel (mono) Sources can use directional and positional effects.
channels = Source:getChannelCount()
channels number 1 for mono, 2 for stereo.
Source:getCone
Gets the Source's directional volume cones. Together with Source:setDirection, the cone angles allow for the Source's volume to vary depending on its direction.
innerAngle, outerAngle, outerVolume = Source:getCone()
innerAngle number The inner angle from the Source's direction, in radians. The Source will play at normal volume if the listener is inside the cone defined by this angle.
outerAngle number The outer angle from the Source's direction, in radians. The Source will play at a volume between the normal and outer volumes, if the listener is in between the cones defined by the inner and outer angles.
outerVolume number The Source's volume when the listener is outside both the inner and outer cone angles.
Source:getDirection
Gets the direction of the Source.
x, y, z = Source:getDirection()
x number The X part of the direction vector.
y number The Y part of the direction vector.
z number The Z part of the direction vector.
Source:getDuration
Gets the duration of the Source. For streaming Sources it may not always be sample-accurate, and may return -1 if the duration cannot be determined at all.
duration = Source:getDuration( unit )
unit ('seconds') TimeUnit The time unit for the return value.
duration number The duration of the Source, or -1 if it cannot be determined.
Source:getEffect
Gets the filter settings associated to a specific effect.

This function returns nil if the effect was applied with no filter settings associated to it.
filtersettings = Source:getEffect( name, filtersettings )
name string The name of the effect.
filtersettings ({}) table An optional empty table that will be filled with the filter settings.
filtersettings table The settings for the filter associated to this effect, or nil if the effect is not present in this Source or has no filter associated. The table has the following fields:
filtersettings.volume number The overall volume of the audio.
filtersettings.highgain number Volume of high-frequency audio. Only applies to low-pass and band-pass filters.
filtersettings.lowgain number Volume of low-frequency audio. Only applies to high-pass and band-pass filters.
Source:getFilter
Gets the filter settings currently applied to the Source.
settings = Source:getFilter()
settings table The filter settings to use for this Source, or nil if the Source has no active filter. The table has the following fields:
settings.type FilterType The type of filter to use.
settings.volume number The overall volume of the audio.
settings.highgain number Volume of high-frequency audio. Only applies to low-pass and band-pass filters.
settings.lowgain number Volume of low-frequency audio. Only applies to high-pass and band-pass filters.
Source:getFreeBufferCount
Gets the number of free buffer slots in a queueable Source. If the queueable Source is playing, this value will increase up to the amount the Source was created with. If the queueable Source is stopped, it will process all of its internal buffers first, in which case this function will always return the amount it was created with.
buffers = Source:getFreeBufferCount()
buffers number How many more SoundData objects can be queued up.
Source:getPitch
Gets the current pitch of the Source.
pitch = Source:getPitch()
pitch number The pitch, where 1.0 is normal.
Source:getPosition
Gets the position of the Source.
x, y, z = Source:getPosition()
x number The X position of the Source.
y number The Y position of the Source.
z number The Z position of the Source.
Source:getRolloff
Returns the rolloff factor of the source.
rolloff = Source:getRolloff()
rolloff number The rolloff factor.
Source:getType
Gets the type of the Source.
sourcetype = Source:getType()
sourcetype SourceType The type of the source.
Source:getVelocity
Gets the velocity of the Source.
x, y, z = Source:getVelocity()
x number The X part of the velocity vector.
y number The Y part of the velocity vector.
z number The Z part of the velocity vector.
Source:getVolume
Gets the current volume of the Source.
volume = Source:getVolume()
volume number The volume of the Source, where 1.0 is normal volume.
Source:getVolumeLimits
Returns the volume limits of the source.
min, max = Source:getVolumeLimits()
min number The minimum volume.
max number The maximum volume.
Source:isLooping
Returns whether the Source will loop.
loop = Source:isLooping()
loop boolean True if the Source will loop, false otherwise.
Source:isPlaying
Returns whether the Source is playing.
playing = Source:isPlaying()
playing boolean True if the Source is playing, false otherwise.
Source:isRelative
Gets whether the Source's position, velocity, direction, and cone angles are relative to the listener.
relative = Source:isRelative()
relative boolean True if the position, velocity, direction and cone angles are relative to the listener, false if they're absolute.
Source:play
Starts playing the Source.
success = Source:play()
success boolean Whether the Source was able to successfully start playing.
Source:queue
Queues SoundData for playback in a queueable Source.

This method requires the Source to be created via love.audio.newQueueableSource.
success = Source:queue( sounddata )
sounddata SoundData The data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.
success boolean True if the data was successfully queued for playback, false if there were no available buffers to use for queueing.
Source:seek
Sets the currently playing position of the Source.
Source:seek( offset, unit )
offset number The position to seek to.
unit ('seconds') TimeUnit The unit of the position value.
Source:setAirAbsorption
Sets the amount of air absorption applied to the Source.

By default the value is set to 0 which means that air absorption effects are disabled. A value of 1 will apply high frequency attenuation to the Source at a rate of 0.05 dB per meter.

Air absorption can simulate sound transmission through foggy air, dry air, smoky atmosphere, etc. It can be used to simulate different atmospheric conditions within different locations in an area.
Source:setAirAbsorption( amount )
amount number The amount of air absorption applied to the Source. Must be between 0 and 10.
Source:setAttenuationDistances
Sets the reference and maximum attenuation distances of the Source. The parameters, combined with the current DistanceModel, affect how the Source's volume attenuates based on distance.

Distance attenuation is only applicable to Sources based on mono (rather than stereo) audio.
Source:setAttenuationDistances( ref, max )
ref number The new reference attenuation distance. If the current DistanceModel is clamped, this is the minimum attenuation distance.
max number The new maximum attenuation distance.
Source:setCone
Sets the Source's directional volume cones. Together with Source:setDirection, the cone angles allow for the Source's volume to vary depending on its direction.
Source:setCone( innerAngle, outerAngle, outerVolume )
innerAngle number The inner angle from the Source's direction, in radians. The Source will play at normal volume if the listener is inside the cone defined by this angle.
outerAngle number The outer angle from the Source's direction, in radians. The Source will play at a volume between the normal and outer volumes, if the listener is in between the cones defined by the inner and outer angles.
outerVolume (0) number The Source's volume when the listener is outside both the inner and outer cone angles.
Source:setDirection
Sets the direction vector of the Source. A zero vector makes the source non-directional.
Source:setDirection( x, y, z )
x number The X part of the direction vector.
y number The Y part of the direction vector.
z number The Z part of the direction vector.
Source:setEffect
Applies an audio effect to the Source.

The effect must have been previously defined using love.audio.setEffect.
success = Source:setEffect( name, enable )
name string The name of the effect previously set up with love.audio.setEffect.
enable (true) boolean If false and the given effect name was previously enabled on this Source, disables the effect.
success boolean Whether the effect was successfully applied to this Source.
success = Source:setEffect( name, filtersettings )
name string The name of the effect previously set up with love.audio.setEffect.
filtersettings table The filter settings to apply prior to the effect, with the following fields:
filtersettings.type FilterType The type of filter to use.
filtersettings.volume number The overall volume of the audio. Must be between 0 and 1.
filtersettings.highgain number Volume of high-frequency audio. Only applies to low-pass and band-pass filters. Must be between 0 and 1.
filtersettings.lowgain number Volume of low-frequency audio. Only applies to high-pass and band-pass filters. Must be between 0 and 1.
success boolean Whether the effect and filter were successfully applied to this Source.
Source:setFilter
Sets a low-pass, high-pass, or band-pass filter to apply when playing the Source.
success = Source:setFilter( settings )
settings table The filter settings to use for this Source, with the following fields:
settings.type FilterType The type of filter to use.
settings.volume number The overall volume of the audio. Must be between 0 and 1.
settings.highgain number Volume of high-frequency audio. Only applies to low-pass and band-pass filters. Must be between 0 and 1.
settings.lowgain number Volume of low-frequency audio. Only applies to high-pass and band-pass filters. Must be between 0 and 1.
success boolean Whether the filter was successfully applied to the Source.
Source:setFilter()
Source:setLooping
Sets whether the Source should loop.
Source:setLooping( loop )
loop boolean True if the source should loop, false otherwise.
Source:setPitch
Sets the pitch of the Source.
Source:setPitch( pitch )
pitch number Calculated with regard to 1 being the base pitch. Each reduction by 50 percent equals a pitch shift of -12 semitones (one octave reduction). Each doubling equals a pitch shift of 12 semitones (one octave increase). Zero is not a legal value.
Source:setPosition
Sets the position of the Source. Please note that this only works for mono (i.e. non-stereo) sound files!
Source:setPosition( x, y, z )
x number The X position of the Source.
y number The Y position of the Source.
z number The Z position of the Source.
Source:setRelative
Sets whether the Source's position, velocity, direction, and cone angles are relative to the listener, or absolute.

By default, all sources are absolute and therefore relative to the origin of love's coordinate system 0, 0. Only absolute sources are affected by the position of the listener. Please note that positional audio only works for mono (i.e. non-stereo) sources.
Source:setRelative( enable )
enable (false) boolean True to make the position, velocity, direction and cone angles relative to the listener, false to make them absolute.
Source:setRolloff
Sets the rolloff factor which affects the strength of the used distance attenuation.

Extended information and detailed formulas can be found in the chapter '3.4. Attenuation By Distance' of OpenAL 1.1 specification.
Source:setRolloff( rolloff )
rolloff number The new rolloff factor.
Source:setVelocity
Sets the velocity of the Source.

This does '''not''' change the position of the Source, but lets the application know how it has to calculate the doppler effect.
Source:setVelocity( x, y, z )
x number The X part of the velocity vector.
y number The Y part of the velocity vector.
z number The Z part of the velocity vector.
Source:setVolume
Sets the current volume of the Source.
Source:setVolume( volume )
volume number The volume for a Source, where 1.0 is normal volume. Volume cannot be raised above 1.0.
Source:setVolumeLimits
Sets the volume limits of the source. The limits have to be numbers from 0 to 1.
Source:setVolumeLimits( min, max )
min number The minimum volume.
max number The maximum volume.
Source:tell
Gets the currently playing position of the Source.
position = Source:tell( unit )
unit ('seconds') TimeUnit The type of unit for the return value.
position number The currently playing position of the Source.
love.data.compress
Compresses a string or data using a specific compression algorithm.
compressedData = love.data.compress( container, format, rawstring, level )
container ContainerType What type to return the compressed data as.
format CompressedDataFormat The format to use when compressing the string.
rawstring string The raw (un-compressed) string to compress.
level (-1) number The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.
compressedData CompressedData or string CompressedData/string which contains the compressed version of rawstring.
compressedData = love.data.compress( container, format, data, level )
container ContainerType What type to return the compressed data as.
format CompressedDataFormat The format to use when compressing the data.
data Data A Data object containing the raw (un-compressed) data to compress.
level (-1) number The level of compression to use, between 0 and 9. -1 indicates the default level. The meaning of this argument depends on the compression format being used.
compressedData CompressedData or string CompressedData/string which contains the compressed version of data.
love.data.decode
Decode Data or a string from any of the EncodeFormats to Data or string.
decoded = love.data.decode( container, format, sourceString )
container ContainerType What type to return the decoded data as.
format EncodeFormat The format of the input data.
sourceString string The raw (encoded) data to decode.
decoded ByteData or string ByteData/string which contains the decoded version of source.
decoded = love.data.decode( container, format, sourceData )
container ContainerType What type to return the decoded data as.
format EncodeFormat The format of the input data.
sourceData Data The raw (encoded) data to decode.
decoded ByteData or string ByteData/string which contains the decoded version of source.
love.data.decompress
Decompresses a CompressedData or previously compressed string or Data object.
decompressedData = love.data.decompress( container, compressedData )
container ContainerType What type to return the decompressed data as.
compressedData CompressedData The compressed data to decompress.
decompressedData Data or string Data/string containing the raw decompressed data.
decompressedData = love.data.decompress( container, format, compressedString )
container ContainerType What type to return the decompressed data as.
format CompressedDataFormat The format that was used to compress the given string.
compressedString string A string containing data previously compressed with love.data.compress.
decompressedData Data or string Data/string containing the raw decompressed data.
decompressedData = love.data.decompress( container, format, data )
container ContainerType What type to return the decompressed data as.
format CompressedDataFormat The format that was used to compress the given data.
data Data A Data object containing data previously compressed with love.data.compress.
decompressedData Data or string Data/string containing the raw decompressed data.
love.data.encode
Encode Data or a string to a Data or string in one of the EncodeFormats.
encoded = love.data.encode( container, format, sourceString, linelength )
container ContainerType What type to return the encoded data as.
format EncodeFormat The format of the output data.
sourceString string The raw data to encode.
linelength (0) number The maximum line length of the output. Only supported for base64, ignored if 0.
encoded ByteData or string ByteData/string which contains the encoded version of source.
encoded = love.data.encode( container, format, sourceData, linelength )
container ContainerType What type to return the encoded data as.
format EncodeFormat The format of the output data.
sourceData Data The raw data to encode.
linelength (0) number The maximum line length of the output. Only supported for base64, ignored if 0.
encoded ByteData or string ByteData/string which contains the encoded version of source.
love.data.getPackedSize
Gets the size in bytes that a given format used with love.data.pack will use.

This function behaves the same as Lua 5.3's string.packsize.
size = love.data.getPackedSize( format )
format string A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
size number The size in bytes that the packed data will use.
love.data.hash
Compute the message digest of a string using a specified hash algorithm.
rawdigest = love.data.hash( hashFunction, string )
hashFunction HashFunction Hash algorithm to use.
string string String to hash.
rawdigest string Raw message digest string.
rawdigest = love.data.hash( hashFunction, data )
hashFunction HashFunction Hash algorithm to use.
data Data Data to hash.
rawdigest string Raw message digest string.
love.data.newByteData
Creates a new Data object containing arbitrary bytes.

Data:getPointer along with LuaJIT's FFI can be used to manipulate the contents of the ByteData object after it has been created.
bytedata = love.data.newByteData( datastring )
datastring string The byte string to copy.
bytedata ByteData The new Data object.
bytedata = love.data.newByteData( Data, offset, size )
Data Data The existing Data object to copy.
offset (0) number The offset of the subsection to copy, in bytes.
size (data:getSize()) number The size in bytes of the new Data object.
bytedata ByteData The new Data object.
bytedata = love.data.newByteData( size )
size number The size in bytes of the new Data object.
bytedata ByteData The new Data object.
love.data.newDataView
Creates a new Data referencing a subsection of an existing Data object.
view = love.data.newDataView( data, offset, size )
data Data The Data object to reference.
offset number The offset of the subsection to reference, in bytes.
size number The size in bytes of the subsection to reference.
view Data The new Data view.
love.data.pack
Packs (serializes) simple Lua values.

This function behaves the same as Lua 5.3's string.pack.
data = love.data.pack( container, format, v1, ... )
container ContainerType What type to return the encoded data as.
format string A string determining how the values are packed. Follows the rules of Lua 5.3's string.pack format strings.
v1 number or boolean or string The first value (number, boolean, or string) to serialize.
... number or boolean or string Additional values to serialize.
data Data or string Data/string which contains the serialized data.
love.data.unpack
Unpacks (deserializes) a byte-string or Data into simple Lua values.

This function behaves the same as Lua 5.3's string.unpack.
v1, ..., index = love.data.unpack( format, datastring, pos )
format string A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
datastring string A string containing the packed (serialized) data.
pos (1) number Where to start reading in the string. Negative values can be used to read relative from the end of the string.
v1 number or boolean or string The first value (number, boolean, or string) that was unpacked.
... number or boolean or string Additional unpacked values.
index number The index of the first unread byte in the data string.
v1, ..., index = love.data.unpack( format, data, pos )
format string A string determining how the values were packed. Follows the rules of Lua 5.3's string.pack format strings.
data Data A Data object containing the packed (serialized) data.
pos (1) number 1-based index indicating where to start reading in the Data. Negative values can be used to read relative from the end of the Data object.
v1 number or boolean or string The first value (number, boolean, or string) that was unpacked.
... number or boolean or string Additional unpacked values.
index number The 1-based index of the first unread byte in the Data.
CompressedData:getFormat
Gets the compression format of the CompressedData.
format = CompressedData:getFormat()
format CompressedDataFormat The format of the CompressedData.
love.event.poll
Returns an iterator for messages in the event queue.
i = love.event.poll()
i function Iterator function usable in a for loop.
love.event.pump
Pump events into the event queue.

This is a low-level function, and is usually not called by the user, but by love.run.

Note that this does need to be called for any OS to think you're still running,

and if you want to handle OS-generated events at all (think callbacks).
love.event.pump()
love.event.push
Adds an event to the event queue.

From 0.10.0 onwards, you may pass an arbitrary amount of arguments with this function, though the default callbacks don't ever use more than six.
love.event.push( n, a, b, c, d, e, f, ... )
n Event The name of the event.
a (nil) Variant First event argument.
b (nil) Variant Second event argument.
c (nil) Variant Third event argument.
d (nil) Variant Fourth event argument.
e (nil) Variant Fifth event argument.
f (nil) Variant Sixth event argument.
... (nil) Variant Further event arguments may follow.
love.event.quit
Adds the quit event to the queue.

The quit event is a signal for the event handler to close LÖVE. It's possible to abort the exit process with the love.quit callback.
love.event.quit( exitstatus )
exitstatus (0) number The program exit status to use when closing the application.
love.event.quit( 'restart' )
'restart' string Tells the default love.run to exit and restart the game without relaunching the executable.
love.event.wait
Like love.event.poll(), but blocks until there is an event in the queue.
n, a, b, c, d, e, f, ... = love.event.wait()
n Event The name of event.
a Variant First event argument.
b Variant Second event argument.
c Variant Third event argument.
d Variant Fourth event argument.
e Variant Fifth event argument.
f Variant Sixth event argument.
... Variant Further event arguments may follow.
love.filesystem.append
Append data to an existing file.
success, errormsg = love.filesystem.append( name, data, size )
name string The name (and path) of the file.
data string The string data to append to the file.
size (all) number How many bytes to write.
success boolean True if the operation was successful, or nil if there was an error.
errormsg string The error message on failure.
success, errormsg = love.filesystem.append( name, data, size )
name string The name (and path) of the file.
data Data The Data object to append to the file.
size (all) number How many bytes to write.
success boolean True if the operation was successful, or nil if there was an error.
errormsg string The error message on failure.
love.filesystem.areSymlinksEnabled
Gets whether love.filesystem follows symbolic links.
enable = love.filesystem.areSymlinksEnabled()
enable boolean Whether love.filesystem follows symbolic links.
love.filesystem.createDirectory
Recursively creates a directory.

When called with 'a/b' it creates both 'a' and 'a/b', if they don't exist already.
success = love.filesystem.createDirectory( name )
name string The directory to create.
success boolean True if the directory was created, false if not.
love.filesystem.getAppdataDirectory
Returns the application data directory (could be the same as getUserDirectory)
path = love.filesystem.getAppdataDirectory()
path string The path of the application data directory