Difference between revisions of "love.audio.newQueueableSource"

m (updated version from 0.11.0 to 11.0)
m (Arguments: - fixed default buffer count value.)
Line 11: Line 11:
 
{{param|number|bitdepth|Bits per sample (8 or 16).}}
 
{{param|number|bitdepth|Bits per sample (8 or 16).}}
 
{{param|number|channels|1 for mono or 2 for stereo.}}
 
{{param|number|channels|1 for mono or 2 for stereo.}}
{{param|number|buffercount (0)|The number of buffers that can be queued up at any given time with [[Source:queue]]. Cannot be greater than 64. A sensible default (~8) is chosen if no value is specified.}}
+
{{param|number|buffercount (8)|The number of buffers that can be queued up at any given time with [[Source:queue]]. Cannot be greater than 64. A sensible default (~8) is chosen if no value is specified.}}
 +
 
 
=== Returns ===
 
=== Returns ===
 
{{param|Source|source|The new Source usable with [[Source:queue]].}}
 
{{param|Source|source|The new Source usable with [[Source:queue]].}}

Revision as of 13:07, 13 February 2022

Available since LÖVE 11.0
This function is not supported in earlier versions.

Creates a new Source usable for real-time generated sound playback with Source:queue.

O.png This function can be slow if it is called repeatedly, such as from love.update or love.draw. If you need to use a specific resource often, create it once and store it somewhere it can be reused!  



Function

Synopsis

source = love.audio.newQueueableSource( samplerate, bitdepth, channels, buffercount )

Arguments

number samplerate
Number of samples per second when playing.
number bitdepth
Bits per sample (8 or 16).
number channels
1 for mono or 2 for stereo.
number buffercount (8)
The number of buffers that can be queued up at any given time with Source:queue. Cannot be greater than 64. A sensible default (~8) is chosen if no value is specified.

Returns

Source source
The new Source usable with Source:queue.

Notes

The sample rate, bit depth, and channel count of any SoundData used with Source:queue must match the parameters given to this constructor.

See Also

Other Languages