1 Reply Latest reply on Nov 20, 2011 4:44 AM by artguate

    working with raw Microphone data...

    BK_POHS

      so I'm creating an audio recorder and I'm writing the floats from the SampleDataEvent to a byteArray.  Everything works fine locally, but we need to store these files on our server.  I have tried to use Sound.load with the url of the byteArray however I get an IO Error which I assume is prob. because this file is not an mp3.  What I need to do is either find out what type of file the byteArray actually is, so that we can have our backend re-encode from this file type to an mp3, or I need to convert on the front end, to an mp3 and just send that new byteArray along.  I found Thibalt's WaveEncoder library, but this encodes to Wav files, not mp3's.  Any help or suggestions out there about how to resolve this issue?

       

       

      Thanks,

      BK

        • 1. Re: working with raw Microphone data...
          artguate

          It is not in a popular format.  It is simply RAW audio data in FLOATS.

          A WAV file is really a container, not a format in it self, it can store multiple types of formats, with or without compression.

           

          Do note the second sentence.  A good part of audio conversion tools expect raw audio data to be in integers, while the raw data that you get from the mic is actually in FLOAT, which is not the same a DOUBLE.  Flash's Number is a Double.

           

          You also have to be carefull with Endianes of your ByteArray, as this is also very important.