mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-16 05:03:52 +00:00
b586eafd3b
LINE INPUT will now use the faster method if passed a file handle that has been opened FOR BINARY. As such, the _BLINEINPUT command has been removed. qb64.bas now takes advantage of this for reading from '$include files, at least in Include Manager 1. Some tweaking of internal/source/main.txt was required to get things into a sane state, so I'm holing off changing the compiler any further so the auto-builder can make sure everything's smoothed over. Note: Everything should still compile as normal; I'm just being overcautious.
36 lines
No EOL
1.6 KiB
Text
36 lines
No EOL
1.6 KiB
Text
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 "SYNC" 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 "VOL" 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}} "dog.wav", .5
|
|
|
|
{{CodeEnd}}
|
|
|
|
|
|
|
|
|
|
{{PageSeeAlso}}
|
|
|
|
*{{KW|_SNDOPEN}}, {{KW|_SNDPLAY}}, {{KW|_SNDPLAYCOPY}}
|
|
|
|
|
|
{{PageNavigation}} |