Name
CopySample -- clone a sample (V5.0)
Synopsis
[id] = CopySample(source, dest)
Function
This function clones the samples specified by source and creates a copy of it as sample dest. The new sample is independent from the old one so you could free the source sample after it has been cloned.

If you pass Nil as dest, CopySample() will return a handle to the new sample to you. Otherwise the new sample will use the identifier specified in dest.

Inputs
source
source sample id
dest
identifier of the sample to be created or Nil for auto id selection
Results
id
optional: handle to the new sample; will only be returned if you specified Nil in dest
Example
CopySample(1, 10)
FreeSample(1)
The above code creates a new sample 10 which contains the same audio data as sample 1. Then it frees sample 1 because it is no longer needed.

Show TOC