title: How to Save Sound as Ringtone/Notification?
body: <p>Hey everyone so Not sure if this is possible using as3 for Android Air App. I have been at it for a week now with some progress but not what I would want it to be. </p>
  
  <p>So far I have it to where when the user swipes on the sound it brings up the storage location to save the sound on the phone. Only problem is it doesn't let me save it as a ringtone or notification. Just saves it on the device;</p>
  
  <p>I would like for the user to be able to click save and have it save to the ringtones for them to set it as the ringtone etc...</p>
  
  <p>Any help would be appreciated. Here is what I have so far:</p>
  
  <p>I am saving the sounds as wav. Still having some problems with this because once file is on the device and I try to play it, it plays it but then crashes and says can't read file.</p>
  
  <pre><code>var snd:Sound = new sndPanda();
  
          var sndBytes:ByteArray = new ByteArray();
          sndBytes.endian = Endian.LITTLE_ENDIAN;
  
          snd.extract( sndBytes, 44100 * 2 );
  
          var wav:ByteArray = encode( sndBytes );
  
          var f:FileReference = new FileReference(); //save file to phone
          f.save( wav, "Panda.Mp3" ); 
  
  
  
          function encode( data:ByteArray ):ByteArray
          {
              var channels:uint = 2;
              var bits:uint = 16;
              var rate:uint = 44100;
  
              var bytes: ByteArray = new ByteArray();
              bytes.endian = Endian.LITTLE_ENDIAN;
  
              bytes.writeUTFBytes( 'RIFF' );
              bytes.writeInt( uint( data.length + 44 ) );
              bytes.writeUTFBytes( 'WAVE' );
              bytes.writeUTFBytes( 'fmt ' );
              bytes.writeInt( uint( 16 ) );
              bytes.writeShort( uint( 1 ) );
              bytes.writeShort( channels );
              bytes.writeInt( rate );
              bytes.writeInt( uint( rate * channels * ( bits / 8 ) ) );
              bytes.writeShort( uint( channels * ( bits / 8 ) ) );
              bytes.writeShort( bits );
              bytes.writeUTFBytes( 'data' );
              bytes.writeInt( data.length );
              data.position = 0;
              var length:int = data.length - 4;
              while (data.position &lt; length) { // could be better :-)
                  bytes.writeShort(uint(data.readFloat() * 65536));
              }
              bytes.position = 0;
  
              return bytes;
          }
  </code></pre>
  
  <p>As u can see I am using FileReference to save to device. But I know there has to be a way to save as ringtone. Thanks in advance.</p>