1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 13:50:36 +00:00
QB64-PE/internal/help/_SNDPLAYFILE.txt

33 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-03-18 11:36:04 +00:00
{{DISPLAYTITLE:_SNDPLAYFILE}}
2017-10-10 14:55:21 +00:00
The [[_SNDPLAYFILE]] statement is used to play a sound file without generating a handle, automatically closing it after playback finishes.
{{PageSyntax}}
2017-10-10 14:55:21 +00:00
:[[_SNDPLAYFILE]] {{Parameter|filename$}}[, {{Parameter|ignored%}}][, {{Parameter|volume!}}]
{{PageDescription}}
2017-10-10 14:55:21 +00:00
* Supported file formats are '''WAV, OGG and MP3'''. See [[_SNDOPEN]].
* {{Parameter|ignored%}} is an optional parameter , accepted for historical reasons.
2019-04-15 01:15:33 +00:00
** In versions prior to '''build 20170811/60''', {{Parameter|ignored%}} identified if a sound was to be loaded with [[_SNDOPEN|"SYNC" capabilities]], (-1 for true, 0 for false). This is true for all sound files in the latest versions, making this parameter safe to be ignored.
2017-10-10 14:55:21 +00:00
* {{Parameter|volume!}} is a [[SINGLE]] value from 0 (silence) to 1 (full volume). If not used or outside this range, the sound will be played at full volume.
2016-03-18 11:36:04 +00:00
* [[_SNDPLAYFILE]] never creates an error. If the sound cannot be played it takes no further action.
2017-10-10 14:55:21 +00:00
* The sound is closed automatically after it finishes playing.
* When a sound will be used often, open the file with [[_SNDOPEN]] and use [[_SNDPLAYCOPY]] to play the handle instead to reduce the burden on the computer.
2017-10-10 14:55:21 +00:00
{{PageExamples}}
''Example:'' Playing a sound file at half volume.
2016-03-18 11:36:04 +00:00
{{CodeStart}} '' ''
2019-04-15 01:15:33 +00:00
{{Cl|_SNDPLAYFILE}} "dog.wav", , .5 '' ''
{{CodeEnd}}
{{PageSeeAlso}}
2016-03-18 11:36:04 +00:00
* [[_SNDOPEN]], [[_SNDPLAY]]
* [[_SNDPLAYCOPY]]
2019-04-15 01:15:33 +00:00
{{PageNavigation}}
<