SNDLIMIT: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "{{DISPLAYTITLE:_SNDLIMIT}} The _SNDLIMIT statement stops playing a sound after it has been playing for a set number of seconds. {{PageSyntax}} : _SNDLIMIT {{Parameter|handle&}}, {{Parameter|numberOfSeconds!}} {{Parameters}} * The {{Parameter|handle&}} variable name is created using the _SNDOPEN function from a loaded sound file. * {{Parameter|numberOfSeconds!}} is a SINGLE value of seconds that the sound will play. {{PageDescription}} *Sets how lon...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:_SNDLIMIT}}
{{DISPLAYTITLE:_SNDLIMIT}}
The [[_SNDLIMIT]] statement stops playing a sound after it has been playing for a set number of seconds.  
The [[_SNDLIMIT]] statement stops playing a sound after it has been playing for a set number of seconds.




Line 7: Line 7:




{{Parameters}}
{{PageParameters}}
* The {{Parameter|handle&}} variable name is created using the [[_SNDOPEN]] function from a loaded sound file.
* The {{Parameter|handle&}} variable name is created using the [[_SNDOPEN]] function from a loaded sound file.
* {{Parameter|numberOfSeconds!}} is a [[SINGLE]] value of seconds that the sound will play.
* {{Parameter|numberOfSeconds!}} is a [[SINGLE]] value of seconds that the sound will play.
Line 19: Line 19:


{{PageExamples}}
{{PageExamples}}
{{CodeStart}} '' ''
{{CodeStart}}
{{Cl|_SNDLIMIT}} h&, 5.5 '' ''
{{Cl|_SNDLIMIT}} h&, 5.5
{{CodeEnd}}
{{CodeEnd}}



Latest revision as of 02:25, 24 January 2023

The _SNDLIMIT statement stops playing a sound after it has been playing for a set number of seconds.


Syntax

_SNDLIMIT handle&, numberOfSeconds!


Parameters

  • The handle& variable name is created using the _SNDOPEN function from a loaded sound file.
  • numberOfSeconds! is a SINGLE value of seconds that the sound will play.


Description

  • Sets how long a sound will be played in seconds. If the limit is set after the sound is started, the timer starts counting down from when the limit is applied, not from the start of playing.
  • Set numberOfSeconds! to 0 seconds to remove the limit.
  • Pausing or stopping the sound will also remove the limit.


Examples

_SNDLIMIT h&, 5.5


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link