AddAudioFrameEmbedded

AddAudioFrameEmbedded(float, float, float, float, Stream)

Creates a new audio frame with an embedded WAV file and adds it to the end of the shape collection. The embedded audio is added to the Presentation.Audios collection.

public IAudioFrame AddAudioFrameEmbedded(float x, float y, float width, float height, 
    Stream audio_stream)
ParameterTypeDescription
xSingleThe x-coordinate of the new audio frame, in points.
ySingleThe y-coordinate of the new audio frame, in points.
widthSingleThe width of the new audio frame, in points.
heightSingleThe height of the new audio frame, in points.
audio_streamStreamAn input stream containing WAV audio data to embed.

Return Value

The newly created IAudioFrame.

Examples

The following examples shows how to create Audio Frame.

[C#]
// Instantiates a presentation class that represents a presentation file
using (Presentation pres = new Presentation())
{
    // Gets the first slide
    ISlide sld = pres.Slides[0];
    // Loads the the wav sound file to stream
    FileStream fstr = new FileStream("sampleaudio.wav", FileMode.Open, FileAccess.Read);
    // Adds the Audio Frame
    IAudioFrame audioFrame = sld.Shapes.AddAudioFrameEmbedded(50, 150, 100, 100, fstr);
    // Sets the Play Mode and Volume of the Audio
    audioFrame.PlayMode = AudioPlayModePreset.Auto;
    audioFrame.Volume = AudioVolumeMode.Loud;
    // Writes the PowerPoint file to disk
    pres.Save("AudioFrameEmbed_out.pptx", SaveFormat.Pptx);
}

See Also


AddAudioFrameEmbedded(float, float, float, float, IAudio)

Creates a new audio frame and adds it to the end of the shape collection using an existing audio object from the Presentation.Audios list.

public IAudioFrame AddAudioFrameEmbedded(float x, float y, float width, float height, IAudio audio)
ParameterTypeDescription
xSingleThe x-coordinate of the new audio frame, in points.
ySingleThe y-coordinate of the new audio frame, in points.
widthSingleThe width of the new audio frame, in points.
heightSingleThe height of the new audio frame, in points.
audioIAudioAn IAudio instance from the Presentation.Audios collection.

Return Value

The newly created IAudioFrame.

See Also