8 Replies Latest reply on May 10, 2010 4:41 PM by kglad

    MP3 and FileReference

    Andrei1 Level 6

      I am having either thought constipation or lack of knowledge or both. Or maybe I want too much.

      My application allows user to select an MP3 file from his hard drive and upload it to the server utilizing FileReference class -- they browse, select and upload. Everything works fine except I would like to give them an opportunity to listen to MP3 after they select the file but BEFORE they attempt uploading it. Of course I could just let them upload the thing and then stream it back but I don't like an easy life.

      Naturally, loadSound("blah.mp3") doesn't work because I cannot know path to their file (or can I?). In any case I could not find a way to get the path to the selected file, which is fair from the security standpoint.

      I hoped that the file accessed through FileReference would be somehow translated as an object into datatype SOUND (FileReference obviously knows that it deals with MP3 – not the MIME though – and it would be nice to write my_sound:Sound = new Sound(); my_sound = my_selected_file; and get over with the issue) -- in which case I would just start playing it. My high expectations did not come true. I guess the shortest rendition of my question is: Is there any way to convert selected MP3 into sound object, which I can manipulate?

      I hope I am clear...

      Thank you very much!