Difference between revisions of "API Sound.QueueEx"
(XML import API auto-gen) |
|||
(19 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |
− | Queues a sound for playing, with the format provided | + | |- |
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''QueueEx''' | ||
+ | |- | ||
+ | | colspan="2" | Queues a sound for playing, with the format provided | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-h32-icon.png]] - HANDLE | ||
+ | | width="90%" | Sounds | ||
+ | |- | ||
+ | | colspan="2" | The handle of the sound object to queue to | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE[] | ||
+ | | width="90%" | Data | ||
+ | |- | ||
+ | | colspan="2" | The array to play data from | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | ByteOffset | ||
+ | |- | ||
+ | | colspan="2" | The byte-offset in the array to start at | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | SampleFormat | ||
+ | |- | ||
+ | | colspan="2" | Format of the samples | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u32-icon.png]] - ULONG | ||
+ | | width="90%" | Elements | ||
+ | |- | ||
+ | | colspan="2" | The number of sample elements to play | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | RateMul | ||
+ | |- | ||
+ | | colspan="2" | A multiplier to the sounds sample rate | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
− | === | + | ==Detailed description== |
− | + | This adds a sound to the queue to be played when the currently playing sound completes. If no sound is currently playing this will play immediately. | |
− | |||
− | |||
− | |||
− | '' | + | The ''Elements'' is a maximum, and will be bounded to the size of the input ''Array'' if too large. This means passing -1 (unsigned) is the equivalent of 'the full array'. The relevant contents of the ''Array'' are copied so the contents may be altered immediately after this call. |
− | |||
− | '' | + | The format of each sample in ''Array'' is explicitly declared, so the data may be read from a file and its format decided dynamically. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | Floating point samples are assumed to be in the range 0 to 1. All integer values have their sign and bit size considered and are in a range from the minimum to the maximum of their type. | |
− | |||
− | |||
− | |||
− | |||
− | = | + | ''RateMul'' can be used to adjust the sample rate for the sound in software. Linear interpolation is used to scale the input ''Array'' by this factor. This means to play at half the sample rate (so the sound plays twice as slow) set ''RateMul''=0.5. |
− | |||
− | |||
− | |||
− | |||
− | + | ==Examples== | |
− | + | ===Calling in a calculation=== | |
* Declare a variable 'result' of type BOOL | * Declare a variable 'result' of type BOOL | ||
− | * Add to a calculation icon: result = ::Sound.QueueEx(sounds, _arraydata, byteoffset, ::Sound.Fmt_Signed8, elements, ratemul) | + | * Add to a calculation icon: <pre class="brush:[cpp]">result = ::Sound.QueueEx(sounds, _arraydata, byteoffset, ::Sound.Fmt_Signed8, elements, ratemul)</pre> |
Latest revision as of 11:55, 16 January 2023
Detailed description
This adds a sound to the queue to be played when the currently playing sound completes. If no sound is currently playing this will play immediately.
The Elements is a maximum, and will be bounded to the size of the input Array if too large. This means passing -1 (unsigned) is the equivalent of 'the full array'. The relevant contents of the Array are copied so the contents may be altered immediately after this call.
The format of each sample in Array is explicitly declared, so the data may be read from a file and its format decided dynamically.
Floating point samples are assumed to be in the range 0 to 1. All integer values have their sign and bit size considered and are in a range from the minimum to the maximum of their type.
RateMul can be used to adjust the sample rate for the sound in software. Linear interpolation is used to scale the input Array by this factor. This means to play at half the sample rate (so the sound plays twice as slow) set RateMul=0.5.
Examples
Calling in a calculation
- Declare a variable 'result' of type BOOL
- Add to a calculation icon:
result = ::Sound.QueueEx(sounds, _arraydata, byteoffset, ::Sound.Fmt_Signed8, elements, ratemul)