AddAudioFrameEmbedded
Contents
[
Hide
]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)
Parameter | Type | Description |
---|---|---|
x | Single | The x-coordinate of the new audio frame, in points. |
y | Single | The y-coordinate of the new audio frame, in points. |
width | Single | The width of the new audio frame, in points. |
height | Single | The height of the new audio frame, in points. |
audio_stream | Stream | An 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
- interface IAudioFrame
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides
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)
Parameter | Type | Description |
---|---|---|
x | Single | The x-coordinate of the new audio frame, in points. |
y | Single | The y-coordinate of the new audio frame, in points. |
width | Single | The width of the new audio frame, in points. |
height | Single | The height of the new audio frame, in points. |
audio | IAudio | An IAudio instance from the Presentation.Audios collection. |
Return Value
The newly created IAudioFrame
.
See Also
- interface IAudioFrame
- interface IAudio
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides