views:

130

answers:

1

Hi,

I currently have a FileUpload.mxml component that uploads a .m4a to an oracle database, retrieves metadata from the file and saves the metadata info in the database.

to acheive this I use FileReference() and set up, amoung others, the dispatcher.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, completeHandler);

So the file is posted to a php file which saves it as a blob. Once the blob is saved, the script sends a message back to flex to dispatch the upload_complete_data event.

In the complete handler, the metadata is then retreived by reading the value back from the database into a custom made meta data reader. The metadata info is then saved via flex.

This seems a little long winded. Has anyone else successfully achieved this using a different way?

+1  A: 

Fleshing out the comment above, I've got a BLOB (called CONTENT) in a table called LOADED_FILE. I convert it to an OrdAudio (with the setProperties flag to true, as it is the properties you want to extract) and then extract bits of metadata :

select a.content.getAudioDuration( ) ,
       a.content.getCompressionType( ), 
       a.content.getEncoding( ) ,
       a.content.getMimeType( ), 
       a.content.getNumberOfChannels( ), 
       a.content.getSampleSize( ) ,
       a.content.getSamplingRate( )
from (select ordsys.ordaudio(content,1) content from loaded_files)  a;

In a proper app, I'd probably store it as an OrdAudio rather than a plain blob.

Gary
I'm not sure that ordaudio can extract metadata that I'm interested in, like track title, genre, etc from an m4a. I know it supports the storage of metadata.
Angus