Name
SAMPLE -- preload a sound sample for later use (V2.0)
Synopsis
@SAMPLE id, filename$[, table]
Function
Use this preprocessor command to preload a sound sample which you want to play later using PlaySample().

The third argument is optional. It is a table that can be used to set further options for the loading operation. The following fields of the table can be used:

Link:
Set this field to False if you do not want to have this sample linked to your executable/applet when you compile your script. This field defaults to True which means that the sample is linked to your executable/applet when Hollywood is in compile mode.

Loader:
This tag allows you to specify one or more format loaders that should be asked to load this sample. This must be set to a string containing the name(s) of one or more loader(s). Defaults to default. See Loaders and adapters for details. (V6.0)

Adapter:
This tag allows you to specify one or more file adapters that should be asked to open the specified file. This must be set to a string containing the name(s) of one or more adapter(s). Defaults to default. See Loaders and adapters for details. (V6.0)

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.

If you want to load the sample manually, please use the LoadSample() command.

Inputs
id
a value that is used to identify this sample later in the code
filename$
the sound sample you want to have loaded
table
optional: a table configuring further options (see above)
Example
@SAMPLE 1, "Gunshot.8svx"
The above declaration assigns sample number 5 to the sample "Gunshot.8svx".


@SAMPLE 1, "Sound/Samples/Gunshot.wav", {Link=False}
Does the same as above but the sample will not be linked when the script is compiled.

Show TOC