AudioFrame

Inheritance: java.lang.Object, com.aspose.slides.Shape, com.aspose.slides.GeometryShape, com.aspose.slides.PictureFrame

All Implemented Interfaces: com.aspose.slides.IAudioFrame

public class AudioFrame extends PictureFrame implements IAudioFrame

Represents an audio clip on a slide.


The following examples shows how to change Audio Play Options.
  
 Presentation pres = new Presentation("AudioFrameEmbed_out.pptx");
 try {
     // Gets the AudioFrame shape
     AudioFrame audioFrame = (AudioFrame)pres.getSlides().get_Item(0).getShapes().get_Item(0);
     // Sets the Play mode to play on click
     audioFrame.setPlayMode(AudioPlayModePreset.OnClick);
     // Sets the volume to Low
     audioFrame.setVolume(AudioVolumeMode.Low);
     // Sets the audio to play across slides
     audioFrame.setPlayAcrossSlides(true);
     // Disables loop for the audio
     audioFrame.setPlayLoopMode(false);
     // Hides the AudioFrame during the slide show
     audioFrame.setHideAtShowing(true);
     // Rewinds the audio to start after playing
     audioFrame.setRewindAudio(true);
     // Saves the PowerPoint file to disk
     pres.save("AudioFrameEmbed_changed.pptx", SaveFormat.Pptx);
 } finally {
     if (pres != null) pres.dispose();
 }

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 audio is playing across the slides.
setPlayAcrossSlides(boolean value)Determines whether audio is playing across the slides.
getRewindAudio()Determines whether audio is automatically rewinded to start after playing.
setRewindAudio(boolean value)Determines whether 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.

getAudioCdStartTrack()

public final int getAudioCdStartTrack()

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

Returns: int

setAudioCdStartTrack(int value)

public final void setAudioCdStartTrack(int value)

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

Parameters:

ParameterTypeDescription
valueint

getAudioCdStartTrackTime()

public final int getAudioCdStartTrackTime()

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

Returns: int

setAudioCdStartTrackTime(int value)

public final void setAudioCdStartTrackTime(int value)

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

Parameters:

ParameterTypeDescription
valueint

getAudioCdEndTrack()

public final int getAudioCdEndTrack()

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

Returns: int

setAudioCdEndTrack(int value)

public final void setAudioCdEndTrack(int value)

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

Parameters:

ParameterTypeDescription
valueint

getAudioCdEndTrackTime()

public final int getAudioCdEndTrackTime()

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

Returns: int

setAudioCdEndTrackTime(int value)

public final void setAudioCdEndTrackTime(int value)

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

Parameters:

ParameterTypeDescription
valueint

getVolume()

public final int getVolume()

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

Returns: int

setVolume(int value)

public final void setVolume(int value)

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

Parameters:

ParameterTypeDescription
valueint

getPlayMode()

public final int getPlayMode()

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

Returns: int

setPlayMode(int value)

public final void setPlayMode(int value)

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

Parameters:

ParameterTypeDescription
valueint

getHideAtShowing()

public final boolean getHideAtShowing()

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

Returns: boolean

setHideAtShowing(boolean value)

public final void setHideAtShowing(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

getPlayLoopMode()

public final boolean getPlayLoopMode()

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

Returns: boolean

setPlayLoopMode(boolean value)

public final void setPlayLoopMode(boolean value)

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

Parameters:

ParameterTypeDescription
valueboolean

getPlayAcrossSlides()

public final boolean getPlayAcrossSlides()

Determines whether 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 final void setPlayAcrossSlides(boolean value)

Determines whether 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 final boolean getRewindAudio()

Determines whether 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 final void setRewindAudio(boolean value)

Determines whether 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 final boolean getEmbedded()

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

Returns: boolean

getLinkPathLong()

public final 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 final 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 final IAudio getEmbeddedAudio()

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

Returns: IAudio

setEmbeddedAudio(IAudio value)

public final void setEmbeddedAudio(IAudio value)

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

Parameters:

ParameterTypeDescription
valueIAudio