[id] = LoadSample(id, filename$[, table])
filename$
into memory and
assigns the identifier id
to it. If you pass Nil in id
, LoadSample()
will automatically choose an identifier and return it.
Sample formats that are supported on all platforms are RIFF WAVE, IFF 8SVX, IFF 16SV, and sample formats you have a plugin for. Depending on the platform Hollywood is running on, more sample formats might be supported. For example, on Amiga compatible systems Hollywood will be able to open all sample formats you have datatypes for as well.
Starting with Hollywood 6.0, this function accepts an optional table argument which allows you to pass additional parameters:
Loader:
Adapter:
UserTags:
This command is also available from the preprocessor: Use @SAMPLE to preload samples!
Please note that this function loads sample data completely into memory. If you plan to play long samples, you should better use OpenMusic() which buffers only small portions of the sound data in memory.
LoadSample(1, "Sound/Samples/WahWah.wav") PlaySample(1) WaitSampleEnd(1) FreeSample(1)The above code loads the sample "Sound/Samples/WahWah.wav", plays it, waits for it to end and frees it.