Extracting embedded audio problem

Hi,

It seems that the methods for checking if audio is embedded, and extracting embedded
audio do not work for versions after powerpoint 2008. Is that
something that is being worked on ?

Thanks,
Gaurav

Hi Gaurav,

Can you please share the source presentation for necessary investigation on our end. Please also elaborate the issue in some more details as well.

Thanks and Regards,

I’m using powerpoint for mac 2011.
File is attached, it was generated using powerpoint 2007 and windows and worked fine with audio extraction, but after making changes to it using powerpoint 2011 and saving it, audio is no longer being extracted.

Hi Gaurav,

I have investigated the presentation shared by you in detail. I have observed that the issue is not with Aspose.Slides. Actually, the audio sounds that you have used in your presentation are actually linked. PowerPoint links the audio file and and the data for the linked audio files cannot be extracted as it is not embedded inside presentation. Aspose.Slides allows you to either link or embeds the sound in presentation. You can only extract the sound data if AudioFrameEx.isEmbedded() is true. For reference, I have shared the presentation where by I have embedded sound in presentation and have successfully extracted that. Hope it clears the issue.

public static void ExtractAudio()
{
try{

PresentationEx pre= new PresentationEx("D:\\TestSound.pptx");
SlideEx sl;
ShapeEx sh;
byte arr[];
int datalength=0;
String strFilePath = "D://";
FileOutputStream fos =null;
boolean isEmbedded=false;
for(int i=0;i<pre.getSlides ().size();i++)
{
sl=pre.getSlides().get(i);
for(int j=0;j<sl.getShapes().size();j++)
{
sh=sl.getShapes().get (j);

if(sh instanceof AudioFrameEx)
{
AudioFrameEx af=(AudioFrameEx)sh;
isEmbedded=af.isEmbedded();
if(isEmbedded)
{
datalength=af.getAudioData().length;
arr=new byte[datalength];
arr=af.getAudioData();
fos = new FileOutputStream(strFilePath+"Slide_"+i+"_Audio_"+j+".wav");
fos.write(arr);
//fos.write(af.getAudioData());

fos.close();
}
}

}
}

}
catch(Exception e)
{
e.printStackTrace();
}

}

Thanks and Regards,

Hi Mudassir,


I double checked to make sure the WAV files are embedded. If you unzip the pptx file (that I sent you), you can find the WAV files inside the /ppt/Media folder, which would mean that they are contained within the pptx. The slides’ xml files (/ppt/slides/_rels) also indicate the same. Moreover, I tested the presentation on a separate computer and noticed that the sounds didnt work when opened in powerpoint 2007 but worked when viewed using powerpoint 2011, maybe it’s a version problem?

Addition: I have attached a pptx file (2011test.pptx) created using powerpoint for mac 2011 with embedded audio and the isEmbedded() doesn’t return true for it.

Hi Gaurav,

I have observed the presence of wav files in the unzipped presentation. An issue with ID 28228 has been created in our issue tracking system to further investigate and resolve the issue. This thread has also been linked with the issue to keep you updated. We will share the further response with you, once it is shared by our development team.

Best Regards,

Any updates on this yet?

Hi Gaurav,

I am sorry for the delayed response but we are working on your issue. I am in consultation with our development team lead regarding the status of the issue and will share the further information once some information is shared by them.

Thanks and Regards,

The issues you have found earlier (filed as SLIDESJAVA-28228) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.