Hi gang,
I'm developing an After Effects script that writes wav files and that adds XMP metadata inside them before the user can use the "edit original" to modify them inside Audition.
I have no problem to create the Wav file, it's working great.
I seem to have no problem to create and serialize an exemple xmp data.
What I do is this:
I create 4 chunks of data: one for "fmt ", one for the actual wave data ("data"), one for the XMP metadata "_PMX" and one for the header "RIFF". I'm using pack to properly encode my data.
So it gives me something like this:
var chunk1 = [ fmt , pack(V, 16), pack(v, 1), pack(v, channels), pack(V, sampleRate), pack(V, sampleRate * channels * bitsPerSample / 8), pack(v, channels * bitsPerSample / 8), pack(v, bitsPerSample) ].join(''); var chunk2 = [ data, pack(V, samples * channels * bitsPerSample / 8), data ].join(''); var metaXMP = [ _PMX, pack(v, xmp.length), xmp ].join(''); var header = [ RIFF, pack(V, 4 + (8 + chunk1.length) + (8 + chunk2.length) + (8+metaXMP.length)), // Length WAVE ].join('');
My xmp serialized string is that:
var xmp = '<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?><x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk=""><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpDM="http://ns.adobe.com/xmp/1.0/DynamicMedia/" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:dc="http://purl.org/dc/elements/1.1/"><xmp:Rating>3</xmp:Rating></rdf:Description></rdf:RDF></x:xmpmeta><?xpacket end="w"?>';
In the end, I combine all this is the correct order and write the wav file:
var out = [header, chunk1, chunk2, metaXMP].join(''); wavFile.write(out);
When I open the file in Audition, the wav is properly played, but no XMP metadata is found.
If I create the file without metadata, and then add it in Audition and resave the file, I get an almost identical file as mine generated. But I cannot see where I fail to do it properly.
As a side note, I haven't found a way to access and writ the "script" subcategory of the XMP metadata (couldn't find that in the reference pdfs.)
Any Hint ?
Message was edited by: Sébastien Périer / The post was sent with the end of it missing