parsing information from asx

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Does anybody have a kit for analysis and synthesis of asx files?

For reference, asx is a windows protocol for specify audio files to
(as well as providing for some other tags).  For example see the
wikipedia article:

The wikipedia article and other sources describe asx as a "type of
xml metafile", which maybe is correct but is a little misleading.
true is that asx is certainly not xml, because (for example) the tags
not case sensitive.  So it is at most xml-like, and thus the standard
php machinery for manipulating xml files is not really available ---
least not on the analysis end.

I have a pile of these asx files to modify, and before i go off and
write a boatload
of code i'd like to see if somebody else has already done it and has
any insights or code to share.


Re: parsing information from asx

dan wrote:
Quoted text here. Click to load it

Hi Dan,

What do you mean by analysis, synthesis and modify?

Are we talking file metadata here or the actual audio itself?

If it's the audio itself then I guess you'll need to decompress it into
raw PCM data first. Do you have a compelling reason to do this in pure
PHP? There's might be a PHP library to do this but my first instinct
would be to use FFmpeg or Mencoder to convert these to Wav, Aiff or just
Raw audio data - apply your analysis, synthesis and modifications and
then use FFmpeg or Mencoder to convert them back to a compressed format
(assuming you need to store the processed results).


Re: parsing information from asx

Quoted text here. Click to load it

Hi Roger,

Thanks for your post.

By analysis and synthesis i'm referring to the metadata: so
ideally i'd like to walk through the data (analysis), see where
sound files are and maybe point to different ones (modify/synthesis).

The actual sound files themselves are to be completely unchanged.

So: if i were going to change the sound files i'd do it in
c or a c-like language, i imagine.  For the metadata i plan
to write something in php so that it fits in with our code base,
other people can easily modify it, etc etc etc.

So if something exists, i'd like to use it.

But if nothing exists then i'll really hack something up, using
everything i happen to know about the actual files we have.  (I.e.,
whatever code gets cooked up will not be very general.)

Thanks again for your response!


Re: parsing information from asx

dan wrote:
Quoted text here. Click to load it

Hi Dan, from what I can see you should be able to use standard XML tools
on ASX files. I don't see why the tags not being case sensitive is a
problem... If it doesn't matter according to the specification and there
are files out there in the wild that use different cases for the same
tags then it's pretty easy to write a script to pre-process / normalize
them. Then just use simplexml_load_string($filecontents) to suck it in.

From what I understand the asx format has changed over the years so you
might have to write a bit of magic to unify the fields from v1, v2 and
v3 if the field names have changed but I'm not aware of any module or
framework that would do that for you anyway.



Site Timeline