1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-26 06:15:52 +00:00
QB64-PE/internal/help/_SNDPLAYFILE.txt
SMcNeill 6e01fc8dce Altered string compare routines (<,<=,>,>=) so they don't give false results with CHR$(0).
Added new _STRCMP and _STRICMP commands for quick string comparisons.
Cleaned up QB64 to finish removing the QUI (quick user insert) code and folders.
Altered UCASE and LCASE routines to be faster in some situations for us.
2014-09-22 08:19:03 -04:00

36 lines
1.6 KiB
Plaintext

The {{KW|_SNDPLAYFILE}} statement is a simple command to play a sound file with limited options.
{{PageSyntax}}
:'''_SNDPLAYFILE''' {{Parameter|filename$}}[, {{Parameter|sync%}}][, {{Parameter|volume!}}]
{{PageDescription}}
*Filename$ support for: WAVE, OGG, AIFF, RIFF, VOC, MP3, MIDI, MOD
*If sync% is used an opened file must have the &quot;SYNC&quot; capability to play on a side channel. A volume value MUST also be used!
*If sync% is 0 or not used, the sound will be played on the main channel, so playing multiple copies of this sound at the same time won't be possible. (see the {{KW|_SNDOPEN}} function for more information about the way QB64 manages channels)
*If volume! is used an opened file must have the &quot;VOL&quot; capability.
*Volume! is a {{KW|SINGLE}} value from 0(silence) to 1(full volume). If not used, the sound will be played at full volume.
*{{KW|_SNDPLAYFILE}} never creates an error. If the sound cannot be played it takes no further action.
*Changing the usage of sync% and volume! can make a difference as to whether a sound can be played.
*The sound is closed automatically after it finishes playing.
* When a sound will be used often, open the file with {{KW|_SNDOPEN}} and use {{KW|_SNDPLAYCOPY}} to play the handle instead to reduce the burden on a computer.
* '''NOTE:''' Most of the QB64 sound statements and functions require a handle created by [[_SNDOPEN]] to be used.
''Example:'' Playing a song at half volume.
{{CodeStart}}
{{Cl|_SNDPLAYFILE}} &quot;dog.wav&quot;, .5
{{CodeEnd}}
{{PageSeeAlso}}
*{{KW|_SNDOPEN}}, {{KW|_SNDPLAY}}, {{KW|_SNDPLAYCOPY}}
{{PageNavigation}}