>
|
|
>
|
|
>
|
|
Executing the Speaker command produces a function call.
>
|
|
| (1) |
By using commands from the Layout Constructors package a nested function call can be produced which represents a worksheet.
>
|
|
That XML representation of a worksheet can be inserted directly.
>
|
|
>
|
|
>
|
|
The previous example's call to the InsertContent command inserted a component with identity "Speaker0", which still exists in this worksheet. Inserting additional content whose input contains another component with that same identity "Speaker0" incurs a substitution of the input identity in order to avoid a conflict with the identity of the existing component.
The return value of the following call to InsertContent is a table which can be used to reference the substituted identity of the inserted component.
>
|
|
| (2) |
>
|
|
For the next example, an audio clip is read in, and its data is stored in an Array. This data Array is then sent to the speaker component.
>
|
|
The speaker component can play audio data at an arbitrary sample rate. The sound clip being used contains its own intended sample rate. The sample rate is the first attribute of the data Array created by the AudioTools:-Read command.
The speaker component's sample rate is set accordingly.
>
|
|
The data is now sent to the Speaker component, playing the audio clip.
>
|
|