@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.
Would it be possible to add the feature? We really need this one.
@oscarstar
We will conduct a detailed study and try to include this feature in the near future. I’ll let you know as soon as I get the ETA from the development team.
It’s very kind of you, It means a lot to me.
The issues you have found earlier (filed as SLIDESJAVA-38590) have been fixed in Aspose.Slides for Java 22.8 (ZIP).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
@oscarstar,
Please try using the following code snippet with Aspose.Slides 22.8:
Presentation presentation = new Presentation("demo.pptx");
try {
ISlide slide = presentation.getSlides().get_Item(0);
// Gets the effects sequence for the slide
ISequence effectsSequence = slide.getTimeline().getMainSequence();
for (IEffect effect : effectsSequence)
{
if (effect.getSound() == null)
continue;
// Extracts the effect sound in byte array
byte[] audio = effect.getSound().getBinaryData();
}
} finally {
if (presentation != null) presentation.dispose();
}
Awesome! You are my hero!!!
Thank you for your attention and efforts. I can successfully get the audio file,It’s so good. But I still found a small problem. Please review the file in the zip package and the snapshot.
EffectAudio.pptx.zip (1.2 MB)
ui-snapshot.jpg (269.8 KB)
data-snapshot.png (655.1 KB)
We cannot distinguish between [no sound] in slide 2 and [stop the previous sound] in slide 3. Can you give us some guidance?
@oscarstar,
In the sample presentation you provided, I see Spin/Effect/Sound option equals [Stop Previous Sound] on slide 2 with a rectangle and Pulse/Effect/Sound option equals [No Sound] on slide 3 with a hexagon. Could you please confirm that this is what you mean?
Please review the file in this package. You can click the first button to playing sound. You can click the last button to stop the playing sound. Because the last button use [Stop Previous Sound] option.
动画音效测试.pptx.zip (367.2 KB)
Can I get the [Stop Previous Sound] value or enum through our effect api or property?
@oscarstar,
Thank you for the additional presentation file. Unfortunately, I did not find such a feature to read these values using Aspose.Slides. I’ve added a ticket with ID SLIDESJAVA-38896 to our issue tracking system. Our development team will consider implementing such a feature. You will be notified when the issue is resolved.
Thank you for your reply and look forward to your good news.
The issues you have found earlier (filed as SLIDESJAVA-38896) have been fixed in Aspose.Slides for Java 22.11 (JAR).
You can check all fixes on the Release Notes page.
You can also find the latest version of our library on the Product Download page.
@oscarstar,
With Aspose.Slides for Java 22.11, you can use the following code snippet:
Presentation presentation = new Presentation("ActionSoundTest.pptx");
IEffect firstEffect = presentation.getSlides().get_Item(1).getTimeline().getMainSequence().get_Item(0);
if (firstEffect.getStopPreviousSound()) { // Stop Previous Sound
// some code
}
if (firstEffect.getSound() == null) { // No Sound
// some code
}
Great, I’m already using it. Thank you so much!