Embedded Sound (EmbeddedSound class)

EmbeddedSound is a media shape that plays audio from sound data stored within the PowerPoint presentation.

Each presentation contains a repository of SoundData objects (see Accessing Global Resources in the 'Working with Presentations' chapter earlier in this Guide for more about the sound repository). EmbeddedSound objects use a sound that's stored in the sound repository. Sound data may also be shared within the presentation.

Creating a new Embedded Sound

You create a new EmbeddedSound object in the Presentation class, specifying the SoundData you wish to use:

Clipboard createEmbeddedSound(SoundData data) [Presentation]

For example, the following code snippet creates a new EmbeddedSound object.

SoundData camera = new SoundData(new File("sound.wav"), "sound.wav");
Clipboard clipboard = p.createEmbeddedSound(camera);
EmbeddedSound sound = (EmbeddedSound)slide.paste(clipboard);

Note that sound data is automatically added to the repository when an EmbeddedSound object is pasted into a presentation.

Working with existing Embedded Sounds

To determine the sound index used by an existing EmbeddedSound object use:

int getSoundIndex()

To set a new sound index on an existing EmbeddedSound object use:

void setSoundIndex(int index)

Page generated: 2008-01-18 02:53:28 GMT TonicPoint Builder Developer's Guide -- Version 2.3