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

Free Support Forum - aspose.com

Extract embedded WAV file

Hi,
I am working on a project that extracts all the embedded objects from Excel file. I have been able to extract objects like ZIP, DOC, DOCX, PPTX, MP3, EXE etc and save on my Local path by reading its dataobject and filetype, but except WAV file. As, WAV file is embedded as a Sound Recorder Document and I couldnot recognize by any means if it is a Sound recorder document via OleObject. Can anybody tell me if there is any ways that embedde WAV could be recognized as Sound File?

Regards,
Rjv

Hi,

Thanks for your inquiry.

We will look into it soon.

Thank you.

Thanks for your quick response. On that account I want to add something. Upon debugging and looking on the property of OleObject, it is possible to recognize it as Sound Record Document via Non-Public Members, not sure whats the name of that property as it is not being rendered properly in my Visual Studio. I have attached the screenshot in this post. Please Have a look!
Regards,
Rjv

Hi,

Well, I think you may check whether the ole object data is a wav file in your template file using the following code:

OleObject ole = workbook.Worksheets[0].OleObjects[0];
if (ole.FileType == OleFileType.Unknown)
{
if (ole.SourceFullName != null)
{
switch(Path.GetExtension(ole.SourceFullName))
{
case ".wav"://this is wav file
break;

}
}else
{
byte[] oleData = ole.ObjectData;
byte[] oleData = ole.ObjectData;
if (BitConverter.ToUInt32(oleData, 0) == 0x46464952 )//RIFF
{

if (BitConverter.ToUInt32(oleData, 8) == 0x45564157)//WAVE
{
//this is wav file.
}
}
}
}


For your further reference, please check the doc about wav file format: http://www.moon-soft.com/program/FORMAT/sound/wave.htm


Thank you.

Thanks Amjad,
It is what I am looking for. Using the same logic i could extract objects of various other formats as well. Thanks once again!

Regards,
Rjv