IAudioFrame

All Implemented Interfaces: com.aspose.slides.IPictureFrame

public interface IAudioFrame extends IPictureFrame

Represents an audio clip on a slide.

Methods

MethodDescription
getAudioCdStartTrack()Returns or sets a start track index.
setAudioCdStartTrack(int value)Returns or sets a start track index.
getAudioCdStartTrackTime()Returns or sets a start track time.
setAudioCdStartTrackTime(int value)Returns or sets a start track time.
getAudioCdEndTrack()Returns or sets a last track index Read/write int.
setAudioCdEndTrack(int value)Returns or sets a last track index Read/write int.
getAudioCdEndTrackTime()Returns or sets a last track time.
setAudioCdEndTrackTime(int value)Returns or sets a last track time.
getVolume()Returns or sets the audio volume.
setVolume(int value)Returns or sets the audio volume.
getPlayMode()Returns or sets the audio play mode.
setPlayMode(int value)Returns or sets the audio play mode.
getHideAtShowing()Determines whether an AudioFrame is hidden.
setHideAtShowing(boolean value)Determines whether an AudioFrame is hidden.
getPlayLoopMode()Determines whether an audio is looped.
setPlayLoopMode(boolean value)Determines whether an audio is looped.
getPlayAcrossSlides()Determines whether an audio is playing across the slides.
setPlayAcrossSlides(boolean value)Determines whether an audio is playing across the slides.
getRewindAudio()Determines whether an audio is automatically rewinded to start after playing.
setRewindAudio(boolean value)Determines whether an audio is automatically rewinded to start after playing.
getEmbedded()Determines whether a sound is embedded to a presentation.
getLinkPathLong()Returns or sets the name of an audio file which is linked to an AudioFrame.
setLinkPathLong(String value)Returns or sets the name of an audio file which is linked to an AudioFrame.
getEmbeddedAudio()Returns or sets embedded audio object.
setEmbeddedAudio(IAudio value)Returns or sets embedded audio object.
getFadeInDuration()Specifies the time duration for the starting fade of the media in milliseconds.
setFadeInDuration(float value)Specifies the time duration for the starting fade of the media in milliseconds.
getFadeOutDuration()Specifies the time duration for the ending fade of the media in milliseconds.
setFadeOutDuration(float value)Specifies the time duration for the ending fade of the media in milliseconds.
getVolumeValue()Returns or sets the audio volume in percents.
setVolumeValue(float value)Returns or sets the audio volume in percents.
getTrimFromStart()Specifies a duration of time to be removed from the start of the media during playback, in milliseconds.
setTrimFromStart(float value)Specifies a duration of time to be removed from the start of the media during playback, in milliseconds.
getTrimFromEnd()Specifies a duration of time to be removed from the end of the media during playback, in milliseconds.
setTrimFromEnd(float value)Specifies a duration of time to be removed from the end of the media during playback, in milliseconds.

getAudioCdStartTrack()

public abstract int getAudioCdStartTrack()

Returns or sets a start track index. Read/write int.

Returns: int

setAudioCdStartTrack(int value)

public abstract void setAudioCdStartTrack(int value)

Returns or sets a start track index. Read/write int.

Parameters:

ParameterTypeDescription
valueint

getAudioCdStartTrackTime()

public abstract int getAudioCdStartTrackTime()

Returns or sets a start track time. Read/write int.

Returns: int

setAudioCdStartTrackTime(int value)

public abstract void setAudioCdStartTrackTime(int value)

Returns or sets a start track time. Read/write int.

Parameters:

ParameterTypeDescription
valueint

getAudioCdEndTrack()

public abstract int getAudioCdEndTrack()

Returns or sets a last track index Read/write int.

Returns: int

setAudioCdEndTrack(int value)

public abstract void setAudioCdEndTrack(int value)

Returns or sets a last track index Read/write int.

Parameters:

ParameterTypeDescription
valueint

getAudioCdEndTrackTime()

public abstract int getAudioCdEndTrackTime()

Returns or sets a last track time. Read/write int.

Returns: int

setAudioCdEndTrackTime(int value)

public abstract void setAudioCdEndTrackTime(int value)

Returns or sets a last track time. Read/write int.

Parameters:

ParameterTypeDescription
valueint

getVolume()

public abstract int getVolume()

Returns or sets the audio volume. Read/write AudioVolumeMode.

Returns: int

setVolume(int value)

public abstract void setVolume(int value)

Returns or sets the audio volume. Read/write AudioVolumeMode.

Parameters:

ParameterTypeDescription
valueint

getPlayMode()

public abstract int getPlayMode()

Returns or sets the audio play mode. Read/write AudioPlayModePreset.

Returns: int

setPlayMode(int value)

public abstract void setPlayMode(int value)

Returns or sets the audio play mode. Read/write AudioPlayModePreset.

Parameters:

ParameterTypeDescription
valueint

getHideAtShowing()

public abstract boolean getHideAtShowing()

Determines whether an AudioFrame is hidden. Read/write boolean.

Returns: boolean

setHideAtShowing(boolean value)

public abstract void setHideAtShowing(boolean value)

Determines whether an AudioFrame is hidden. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getPlayLoopMode()

public abstract boolean getPlayLoopMode()

Determines whether an audio is looped. Read/write boolean.

Returns: boolean

setPlayLoopMode(boolean value)

public abstract void setPlayLoopMode(boolean value)

Determines whether an audio is looped. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getPlayAcrossSlides()

public abstract 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();
  }

Returns: boolean

setPlayAcrossSlides(boolean value)

public abstract 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();
  }

Parameters:

ParameterTypeDescription
valueboolean

getRewindAudio()

public abstract 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();
  }

Returns: boolean

setRewindAudio(boolean value)

public abstract 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();
  }

Parameters:

ParameterTypeDescription
valueboolean

getEmbedded()

public abstract boolean getEmbedded()

Determines whether a sound is embedded to a presentation. Read-only boolean.

Returns: boolean

getLinkPathLong()

public abstract String getLinkPathLong()

Returns or sets the name of an audio file which is linked to an AudioFrame. Read/write String.

Returns: java.lang.String

setLinkPathLong(String value)

public abstract void setLinkPathLong(String value)

Returns or sets the name of an audio file which is linked to an AudioFrame. Read/write String.

Parameters:

ParameterTypeDescription
valuejava.lang.String

getEmbeddedAudio()

public abstract IAudio getEmbeddedAudio()

Returns or sets embedded audio object. Read/write IAudio.

Returns: IAudio

setEmbeddedAudio(IAudio value)

public abstract void setEmbeddedAudio(IAudio value)

Returns or sets embedded audio object. Read/write IAudio.

Parameters:

ParameterTypeDescription
valueIAudio

getFadeInDuration()

public abstract float getFadeInDuration()

Specifies the time duration for the starting fade 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();
 }

Returns: float

setFadeInDuration(float value)

public abstract void setFadeInDuration(float value)

Specifies the time duration for the starting fade 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();
 }

Parameters:

ParameterTypeDescription
valuefloat

getFadeOutDuration()

public abstract float getFadeOutDuration()

Specifies the time duration for the ending fade 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();
 }

Returns: float

setFadeOutDuration(float value)

public abstract void setFadeOutDuration(float value)

Specifies the time duration for the ending fade 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();
 }

Parameters:

ParameterTypeDescription
valuefloat

getVolumeValue()

public abstract 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();
 }

Returns: float

setVolumeValue(float value)

public abstract 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();
 }

Parameters:

ParameterTypeDescription
valuefloat

getTrimFromStart()

public abstract float getTrimFromStart()

Specifies a duration of time to be removed from the start 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();
 }

Returns: float

setTrimFromStart(float value)

public abstract void setTrimFromStart(float value)

Specifies a duration of time to be removed from the start 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();
 }

Parameters:

ParameterTypeDescription
valuefloat

getTrimFromEnd()

public abstract float getTrimFromEnd()

Specifies a duration of time 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();
 }

Returns: float

setTrimFromEnd(float value)

public abstract void setTrimFromEnd(float value)

Specifies a duration of time 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();
 }

Parameters:

ParameterTypeDescription
valuefloat