AddAudioFrameEmbedded
内容
[
隐藏
]AddAudioFrameEmbedded(float, float, float, float, Stream)
在集合的末尾添加一个带有嵌入音频文件的新音频框。嵌入的音频文件只能是WAV格式。它将新音频添加到Presentation.Audios列表中。
public IAudioFrame AddAudioFrameEmbedded(float x, float y, float width, float height,
Stream audio_stream)
参数 | 类型 | 描述 |
---|---|---|
x | Single | 新音频框的X坐标。 |
y | Single | 新音频框的Y坐标。 |
width | Single | 新音频框的宽度。 |
height | Single | 新音频框的高度。 |
audio_stream | Stream | 带音频数据的输入流。 |
返回值
创建的AudioFrame对象。
示例
以下示例演示了如何创建音频框。
[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);
}
另请参见
- interface IAudioFrame
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides
AddAudioFrameEmbedded(float, float, float, float, IAudio)
在集合的末尾添加一个带有嵌入音频文件的新音频框。它使用来自Presentation.Audios列表的音频文件。
public IAudioFrame AddAudioFrameEmbedded(float x, float y, float width, float height, IAudio audio)
参数 | 类型 | 描述 |
---|---|---|
x | Single | 新音频框的X坐标。 |
y | Single | 新音频框的Y坐标。 |
width | Single | 新音频框的宽度。 |
height | Single | 新音频框的高度。 |
audio | IAudio | 来自Presentation.Audios列表的音频。 |
返回值
创建的AudioFrame对象。
另请参见
- interface IAudioFrame
- interface IAudio
- class ShapeCollection
- namespace Aspose.Slides
- assembly Aspose.Slides