Associated attributes

Usually, with a binary device object you have a set of associated attributes available. A typical example is the camera device which provides the following attributes on Aibo:

In the case of the speaker device, in charge of the speaker producing sound in the Aibo, you have:

With the speaker object, there is also a method that can be used to play a sound directly from a file stored on the memorystick:

speaker.play("mysound.wav");

Alternatively, to avoid having a disk access which might be slow, you can decide to store the content of the "mysound.wav" file in a binary variable kept in memory for frequent use, and then do a simple assignment. For this, use the loadwav function:

mybin = loadwav("mysound.wav");
speaker = mybin;