<< Click to Display Table of Contents >> Navigation: ThinBASIC Modules > TBASS (Sound Module) > Samples > TBASS_SampleLoad |
Description
Loads sample from file or memory.
Syntax
sample = TBASS_LoadSample(mem, source, offset, length, maxPlaybacks, flags)
Returns
Number, sample handle - non-zero in case of success.
Parameters
Name |
Type |
Optional |
Meaning |
||||||||||||||
mem |
Numeric |
No |
flag indicating if you want to load the sample from memory |
||||||||||||||
source |
String / Pointer |
No |
file name (if mem is FALSE), otherwise memory location of sample |
||||||||||||||
offset |
file offset to load the sample from (only used if mem is FALSE). |
||||||||||||||||
length |
Data length... 0 = use all data up to the end of file (if mem is FALSE). If length over-runs the end of the file, it will automatically be lowered to the end of the file. |
||||||||||||||||
maxPlaybacks |
Maximum number of simultaneous playbacks... 1 - 65535. Use one of the %TBASS_SAMPLE_OVER flags to choose the override decider, in the case of there being no free channel available for playback (ie. the sample is already playing maxPlaybacks times) |
||||||||||||||||
flags |
A combination of these flags
|
Remarks
Restrictions
See also
Examples
' Load sample from file on disk, as looping
DWord sample = TBASS_SampleLoad(%TBASS_FALSE, "C:\sounds\mysound.wav", 0, 0, 1, %TBASS_SAMPLE_LOOP)