public interface IAudioFrame extends IPictureFrame
Represents an audio clip on a slide.
| Modifier and Type | Method and Description |
|---|---|
int |
getAudioCdEndTrack()
Returns or sets a last track index
Read/write int.
|
int |
getAudioCdEndTrackTime()
Returns or sets a last track time.
|
int |
getAudioCdStartTrack()
Returns or sets a start track index.
|
int |
getAudioCdStartTrackTime()
Returns or sets a start track time.
|
ICaptionsCollection |
getCaptionTracks()
Gets the collection of closed captions associated with the audio frame.
|
boolean |
getEmbedded()
Determines whether a sound is embedded to a presentation.
|
IAudio |
getEmbeddedAudio()
Returns or sets embedded audio object.
|
float |
getFadeInDuration()
Specifies the time duration for the initial fade-in of the media in milliseconds.
|
float |
getFadeOutDuration()
Specifies the time duration for the ending fade-out of the media in milliseconds.
|
boolean |
getHideAtShowing()
Determines whether an AudioFrame is hidden.
|
java.lang.String |
getLinkPathLong()
Returns or sets the name of an audio file which is linked to an AudioFrame.
|
boolean |
getPlayAcrossSlides()
Determines whether an audio is playing across the slides.
|
boolean |
getPlayLoopMode()
Determines whether an audio is looped.
|
int |
getPlayMode()
Returns or sets the audio play mode.
|
boolean |
getRewindAudio()
Determines whether an audio is automatically rewinded to start after playing.
|
float |
getTrimFromEnd()
Specifies the time duration to be removed from the end of the media during playback, in milliseconds.
|
float |
getTrimFromStart()
Specifies the time duration to be removed from the beginning of the media during playback, in milliseconds.
|
int |
getVolume()
Returns or sets the audio volume.
|
float |
getVolumeValue()
Returns or sets the audio volume in percents.
|
void |
setAudioCdEndTrack(int value)
Returns or sets a last track index
Read/write int.
|
void |
setAudioCdEndTrackTime(int value)
Returns or sets a last track time.
|
void |
setAudioCdStartTrack(int value)
Returns or sets a start track index.
|
void |
setAudioCdStartTrackTime(int value)
Returns or sets a start track time.
|
void |
setEmbeddedAudio(IAudio value)
Returns or sets embedded audio object.
|
void |
setFadeInDuration(float value)
Specifies the time duration for the initial fade-in of the media in milliseconds.
|
void |
setFadeOutDuration(float value)
Specifies the time duration for the ending fade-out of the media in milliseconds.
|
void |
setHideAtShowing(boolean value)
Determines whether an AudioFrame is hidden.
|
void |
setLinkPathLong(java.lang.String value)
Returns or sets the name of an audio file which is linked to an AudioFrame.
|
void |
setPlayAcrossSlides(boolean value)
Determines whether an audio is playing across the slides.
|
void |
setPlayLoopMode(boolean value)
Determines whether an audio is looped.
|
void |
setPlayMode(int value)
Returns or sets the audio play mode.
|
void |
setRewindAudio(boolean value)
Determines whether an audio is automatically rewinded to start after playing.
|
void |
setTrimFromEnd(float value)
Specifies the time duration to be removed from the end of the media during playback, in milliseconds.
|
void |
setTrimFromStart(float value)
Specifies the time duration to be removed from the beginning of the media during playback, in milliseconds.
|
void |
setVolume(int value)
Returns or sets the audio volume.
|
void |
setVolumeValue(float value)
Returns or sets the audio volume in percents.
|
getPictureFormat, getPictureFrameLock, getRelativeScaleHeight, getRelativeScaleWidth, setRelativeScaleHeight, setRelativeScaleWidthcreateShapeElements, getAdjustments, getGeometryPaths, getShapeStyle, getShapeType, setGeometryPath, setGeometryPaths, setShapeTypeaddPlaceholder, getAlternativeText, getAlternativeTextTitle, getBasePlaceholder, getBlackWhiteMode, getConnectionSiteCount, getCustomData, getEffectFormat, getFillFormat, getFrame, getHeight, getHidden, getImage, getImage, getLineFormat, getName, getOfficeInteropShapeId, getParentGroup, getPlaceholder, getRawFrame, getRotation, getShapeLock, getThreeDFormat, getThumbnail, getThumbnail, getUniqueId, getWidth, getX, getY, getZOrderPosition, isDecorative, isGrouped, isTextHolder, removePlaceholder, setAlternativeText, setAlternativeTextTitle, setBlackWhiteMode, setDecorative, setFrame, setHeight, setHidden, setName, setRawFrame, setRotation, setWidth, setX, setY, writeAsSvg, writeAsSvggetSlidegetPresentationgetHyperlinkClick, getHyperlinkManager, getHyperlinkMouseOver, setHyperlinkClick, setHyperlinkMouseOverint getAudioCdStartTrack()
Returns or sets a start track index. Read/write int.
void setAudioCdStartTrack(int value)
Returns or sets a start track index. Read/write int.
int getAudioCdStartTrackTime()
Returns or sets a start track time. Read/write int.
void setAudioCdStartTrackTime(int value)
Returns or sets a start track time. Read/write int.
int getAudioCdEndTrack()
Returns or sets a last track index Read/write int.
void setAudioCdEndTrack(int value)
Returns or sets a last track index Read/write int.
int getAudioCdEndTrackTime()
Returns or sets a last track time. Read/write int.
void setAudioCdEndTrackTime(int value)
Returns or sets a last track time. Read/write int.
int getVolume()
Returns or sets the audio volume.
Read/write AudioVolumeMode.
void setVolume(int value)
Returns or sets the audio volume.
Read/write AudioVolumeMode.
int getPlayMode()
Returns or sets the audio play mode.
Read/write AudioPlayModePreset.
void setPlayMode(int value)
Returns or sets the audio play mode.
Read/write AudioPlayModePreset.
boolean getHideAtShowing()
Determines whether an AudioFrame is hidden. Read/write boolean.
void setHideAtShowing(boolean value)
Determines whether an AudioFrame is hidden. Read/write boolean.
boolean getPlayLoopMode()
Determines whether an audio is looped. Read/write boolean.
void setPlayLoopMode(boolean value)
Determines whether an audio is looped. Read/write boolean.
boolean getPlayAcrossSlides()
Determines whether an audio is playing across the slides. Read/write boolean.
Presentation pres = new Presentation(); try{ ISlide slide = pres.getSlides().get_Item(0); // Add Audio Frame IAudioFrame audioFrame = slide.getShapes().addAudioFrameLinked(50, 50, 100, 100, "sampleaudio.wav"); // Set Audio to play across the slides audioFrame.setPlayAcrossSlides(true); // Set Audio to automatically rewind to start after playing audioFrame.setRewindAudio(true); pres.save("AudioFrame_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
void setPlayAcrossSlides(boolean value)
Determines whether an audio is playing across the slides. Read/write boolean.
Presentation pres = new Presentation(); try{ ISlide slide = pres.getSlides().get_Item(0); // Add Audio Frame IAudioFrame audioFrame = slide.getShapes().addAudioFrameLinked(50, 50, 100, 100, "sampleaudio.wav"); // Set Audio to play across the slides audioFrame.setPlayAcrossSlides(true); // Set Audio to automatically rewind to start after playing audioFrame.setRewindAudio(true); pres.save("AudioFrame_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
boolean getRewindAudio()
Determines whether an audio is automatically rewinded to start after playing. Read/write boolean.
Presentation pres = new Presentation(); try{ ISlide slide = pres.getSlides().get_Item(0); // Add Audio Frame IAudioFrame audioFrame = slide.getShapes().addAudioFrameLinked(50, 50, 100, 100, "sampleaudio.wav"); // Set Audio to play across the slides audioFrame.setPlayAcrossSlides(true); // Set Audio to automatically rewind to start after playing audioFrame.setRewindAudio(true); pres.save("AudioFrame_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
void setRewindAudio(boolean value)
Determines whether an audio is automatically rewinded to start after playing. Read/write boolean.
Presentation pres = new Presentation(); try{ ISlide slide = pres.getSlides().get_Item(0); // Add Audio Frame IAudioFrame audioFrame = slide.getShapes().addAudioFrameLinked(50, 50, 100, 100, "sampleaudio.wav"); // Set Audio to play across the slides audioFrame.setPlayAcrossSlides(true); // Set Audio to automatically rewind to start after playing audioFrame.setRewindAudio(true); pres.save("AudioFrame_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
boolean getEmbedded()
Determines whether a sound is embedded to a presentation. Read-only boolean.
java.lang.String getLinkPathLong()
Returns or sets the name of an audio file which is linked to an AudioFrame.
Read/write String.
void setLinkPathLong(java.lang.String value)
Returns or sets the name of an audio file which is linked to an AudioFrame.
Read/write String.
IAudio getEmbeddedAudio()
Returns or sets embedded audio object.
Read/write IAudio.
void setEmbeddedAudio(IAudio value)
Returns or sets embedded audio object.
Read/write IAudio.
float getFadeInDuration()
Specifies the time duration for the initial fade-in of the media in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the duration of the starting fade for 200ms audioFrame.setFadeInDuration(200f); pres.save("AudioFrameFade_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
void setFadeInDuration(float value)
Specifies the time duration for the initial fade-in of the media in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the duration of the starting fade for 200ms audioFrame.setFadeInDuration(200f); pres.save("AudioFrameFade_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
float getFadeOutDuration()
Specifies the time duration for the ending fade-out of the media in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the duration of the ending fade for 500ms audioFrame.setFadeOutDuration(500f); pres.save("AudioFrameFade_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
void setFadeOutDuration(float value)
Specifies the time duration for the ending fade-out of the media in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the duration of the ending fade for 500ms audioFrame.setFadeOutDuration(500f); pres.save("AudioFrameFade_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
float getVolumeValue()
Returns or sets the audio volume in percents. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the audio volume for 85% audioFrame.setVolumeValue(85f); pres.save("AudioFrameValue_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
void setVolumeValue(float value)
Returns or sets the audio volume in percents. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the audio volume for 85% audioFrame.setVolumeValue(85f); pres.save("AudioFrameValue_out.pptx", SaveFormat.Pptx); } finally { if (pres != null) pres.dispose(); }
float getTrimFromStart()
Specifies the time duration to be removed from the beginning of the media during playback, in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the start trimming time 1.5 seconds audioFrame.setTrimFromStart(1500f); } finally { if (pres != null) pres.dispose(); }
void setTrimFromStart(float value)
Specifies the time duration to be removed from the beginning of the media during playback, in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the start trimming time 1.5 seconds audioFrame.setTrimFromStart(1500f); } finally { if (pres != null) pres.dispose(); }
float getTrimFromEnd()
Specifies the time duration to be removed from the end of the media during playback, in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the end trimming time 2 seconds audioFrame.setTrimFromEnd(2000f); } finally { if (pres != null) pres.dispose(); }
void setTrimFromEnd(float value)
Specifies the time duration to be removed from the end of the media during playback, in milliseconds. Read/write float.
Example:Presentation pres = new Presentation(); try { FileInputStream audioStream = new FileInputStream("sampleaudio.mp3"); IAudio audio = pres.getAudios().addAudio(audioStream, LoadingStreamBehavior.ReadStreamAndRelease); IAudioFrame audioFrame = pres.getSlides().get_Item(0).getShapes().addAudioFrameEmbedded(50, 50, 100, 100, audio); // Set the end trimming time 2 seconds audioFrame.setTrimFromEnd(2000f); } finally { if (pres != null) pres.dispose(); }
ICaptionsCollection getCaptionTracks()
Gets the collection of closed captions associated with the audio frame.
This property is read-only and returns an ICaptionsCollection containing all caption tracks.
Example:Presentation pres = new Presentation("audio with captions.pptx"); try { for (IShape shape : pres.getSlides().get_Item(0).getShapes()) { if (shape instanceof IAudioFrame) { IAudioFrame audioFrame = (IAudioFrame) shape; // Save the caption track's binary data as a .vtt file for (ICaptions captionTrack : audioFrame.getCaptionTracks()) { FileOutputStream fos = new FileOutputStream(captionTrack.getCaptionId() + ".vtt"); fos.write(captionTrack.getBinaryData()); fos.close(); } } } } finally { if (pres != null) pres.dispose(); }
Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.