Difference between revisions of "Source:queue"
m (0.11.0 -> 11.0) |
m (Apparently slime just told us about the other 2 variants.) |
||
Line 3: | Line 3: | ||
This method requires the Source to be created via [[love.audio.newQueueableSource]]. | This method requires the Source to be created via [[love.audio.newQueueableSource]]. | ||
+ | |||
== Function == | == Function == | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
− | success = Source:queue( | + | success = Source:queue( soundData, length ) |
</source> | </source> | ||
=== Arguments === | === Arguments === | ||
− | {{param|SoundData| | + | {{param|SoundData|soundData|The data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.}} |
+ | {{param|number|length ([[Data:getSize|sounddata:getSize()]])|Length in bytes to queue.}} | ||
=== Returns === | === Returns === | ||
{{param|boolean|success|True if the data was successfully queued for playback, false if there were no [[Source:getFreeBufferCount|available buffers]] to use for queueing.}} | {{param|boolean|success|True if the data was successfully queued for playback, false if there were no [[Source:getFreeBufferCount|available buffers]] to use for queueing.}} | ||
+ | |||
+ | == Function == | ||
+ | === Synopsis === | ||
+ | <source lang="lua"> | ||
+ | success = Source:queue( soundData, offset, length ) | ||
+ | </source> | ||
+ | === Arguments === | ||
+ | {{param|SoundData|soundData|The data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.}} | ||
+ | {{param|number|offset|Starting position in bytes to queue.}} | ||
+ | {{param|number|length|Length in bytes to queue starting from specified offset.}} | ||
+ | === Returns === | ||
+ | {{param|boolean|success|True if the data was successfully queued for playback, false if there were no [[Source:getFreeBufferCount|available buffers]] to use for queueing.}} | ||
+ | |||
+ | == Notes == | ||
+ | To convert sample unit to bytes, multiply the sample unit by <code>SoundData:getBitDepth() * SoundData:getChannelCount() / 8</code>. | ||
+ | |||
== See Also == | == See Also == | ||
* [[parent::Source]] | * [[parent::Source]] |
Revision as of 15:19, 25 April 2020
Available since LÖVE 11.0 |
This function is not supported in earlier versions. |
Queues SoundData for playback in a queueable Source.
This method requires the Source to be created via love.audio.newQueueableSource.
Contents
Function
Synopsis
success = Source:queue( soundData, length )
Arguments
SoundData soundData
- The data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.
number length (sounddata:getSize())
- Length in bytes to queue.
Returns
boolean success
- True if the data was successfully queued for playback, false if there were no available buffers to use for queueing.
Function
Synopsis
success = Source:queue( soundData, offset, length )
Arguments
SoundData soundData
- The data to queue. The SoundData's sample rate, bit depth, and channel count must match the Source's.
number offset
- Starting position in bytes to queue.
number length
- Length in bytes to queue starting from specified offset.
Returns
boolean success
- True if the data was successfully queued for playback, false if there were no available buffers to use for queueing.
Notes
To convert sample unit to bytes, multiply the sample unit by SoundData:getBitDepth() * SoundData:getChannelCount() / 8
.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info