1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 15:00:38 +00:00
QB64-PE/internal/help/_SNDRAWLEN.txt

28 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_SNDRAWLEN}}
2017-10-10 14:55:21 +00:00
The [[_SNDRAWLEN]] function returns the length, in seconds, of a [[_SNDRAW]] sound currently queued.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
: {{Parameter|length#}} = [[_SNDRAWLEN]]
2017-10-10 14:55:21 +00:00
{{PageDescription}}
* Use [[_SNDRAWLEN]] to determine the length of a sound queue during creation and when to stop playing the sound.
* Ensure that [[_SNDRAWLEN]] is comfortably above 0 (until you've actually finished playing sound).
* If you are getting occasional random clicks, this generally means that [[_SNDRAWLEN]] has dropped to 0.
* The [[_SNDRATE]] determines how many samples are played per second. However, the timing is achieved by the sound card and [[_SNDRAWLEN]], not your program.
* '''Do not attempt to use [[_TIMER]] or [[_DELAY]] or [[_LIMIT]] to control the timing of [[_SNDRAW]] sounds. You may use them as usual for delays or to limit your program's CPU usage, but the decision of how much sound to queue should only be based on the remaining _SNDRAWLEN'''.
2017-10-10 14:55:21 +00:00
{{PageExamples}}
* See the example in [[_SNDRAW]]
2017-10-10 14:55:21 +00:00
{{PageSeeAlso}}
* [[_SNDRAW]]
* [[_SNDRATE]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}
<