We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to Extract Audio File from Slide Timeline?

Please open the file in the zip package and review the picutre below.
animation audio.pptx.zip (325.0 KB)
animation audio.png (154.3 KB)
Could you tell me how to get the drumroll.wav audio file in animation timeline?I am very grateful.

@oscarstar,
Thank you for posting the query. You can extract audio contents from the presentation using Aspose.Slides as shown below:

Presentation presentation = new Presentation(dataPath + "animation audio.pptx");
for (int i = 0; i < presentation.getAudios().size(); i++)
{
    IAudio audio = presentation.getAudios().get_Item(i);
    if(audio.getContentType() == "audio/x-wav")
    {
        File audioFile = new File(dataPath + "audio_" + i + ".wav");
        OutputStream outputStream = new FileOutputStream(audioFile);
        IOUtils.copy(audio.getStream(), outputStream);
    }
}

API Reference: IAudio interface

If the issue persists, please clarify your requirments.

Thank you for your reply.I hope to find the file or relation in the timeline animation collection.Please review the code below:
Presentation presentation = new Presentation(dataPath + “animation audio.pptx”);
IBehaviorCollection collection = presentation.getSlides().get_Item(0).getTimeline().getMainSequence().get_Item(0).getBehaviors();
for (int i = 0; i < collection.getCount(); i++) {
// todo: find the command effect and get the audio setting
}
I can’t find the audio file or relation in the collection or any where.Could you help me to find the relation of the audio and animation effect?Thanks a lot.

@oscarstar,
Unfortunately, I have not found a way to extract audio from the slide timeline. There seems to be no corresponding feature. I logged the issue with ID SLIDESJAVA-38590 in our tracking system. Our development team will investigate such a possibility. I will inform you of any progress.

Any progress?

@oscarstar,
I’ve requested an estimated time to implement such a feature from our development team. We will let you know as soon as possible.