AddAudioFrameEmbedded

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

Adds a new audio frame with embedded audio file to the end of a collection. Embedded audio file can be a WAV only. It adds new audio into Presentation.Audios list.

public IAudioFrame AddAudioFrameEmbedded(float x, float y, float width, float height, 
    Stream audio_stream)
ParameterTypeDescription
xSingleX coordinate of a new audio frame.
ySingleY coordinate of a new audio frame.
widthSingleWidth of a new audio frame.
heightSingleHeight of a new audio frame.
audio_streamStreamInout stream with audio data.

Return Value

Created AudioFrame object.

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)

Adds a new audio frame with embedded audio file to the end of a collection. It uses audio file from Presentation.Audios list.

public IAudioFrame AddAudioFrameEmbedded(float x, float y, float width, float height, IAudio audio)
ParameterTypeDescription
xSingleX coordinate of a new audio frame.
ySingleY coordinate of a new audio frame.
widthSingleWidth of a new audio frame.
heightSingleHeight of a new audio frame.
audioIAudioAudio from Presentation.Audios list.

Return Value

Created AudioFrame object.

See Also