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)
Parameter | Type | Description |
---|---|---|
x | Single | X coordinate of a new audio frame. |
y | Single | Y coordinate of a new audio frame. |
width | Single | Width of a new audio frame. |
height | Single | Height of a new audio frame. |
audio_stream | Stream | Inout 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
- interface IAudioFrame
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides
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)
Parameter | Type | Description |
---|---|---|
x | Single | X coordinate of a new audio frame. |
y | Single | Y coordinate of a new audio frame. |
width | Single | Width of a new audio frame. |
height | Single | Height of a new audio frame. |
audio | IAudio | Audio from Presentation.Audios list. |
Return Value
Created AudioFrame object.
See Also
- interface IAudioFrame
- interface IAudio
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides