title: Android Voice changing app need help in storing changed voice
body: <p>In one of my app i need to change sound frequency like it should be in thick voice for that i have use
  <a href="http://android-er.blogspot.hk/2012/06/implement-voice-changer-by-changing.html" rel="nofollow">THIS LINK</a></p>
  
  <p>The above link code works fine for me...</p>
  
  <p>While playing audio it change voice</p>
  
  <p>My problem is HOW TO STORE THIS CHANGED VOICE?</p>
  
  <p>this is method which play voice with changing in voice</p>
  
  <pre><code>void playRecord(){
  
    File file = new File(Environment.getExternalStorageDirectory(), "test.pcm");
  
          int shortSizeInBytes = Short.SIZE/Byte.SIZE;
  
    int bufferSizeInBytes = (int)(file.length()/shortSizeInBytes);
    short[] audioData = new short[bufferSizeInBytes];
  
    try {
     InputStream inputStream = new FileInputStream(file);
     BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
     DataInputStream dataInputStream = new DataInputStream(bufferedInputStream);
  
     int i = 0;
     while(dataInputStream.available() &gt; 0){
      audioData[i] = dataInputStream.readShort();
      i++;
     }
  
     dataInputStream.close();
  
     int sampleFreq = (Integer)spFrequency.getSelectedItem();
  
     AudioTrack audioTrack = new AudioTrack(
       AudioManager.STREAM_MUSIC,
       sampleFreq,
       AudioFormat.CHANNEL_CONFIGURATION_MONO,
       AudioFormat.ENCODING_PCM_16BIT,
       bufferSizeInBytes,
       AudioTrack.MODE_STREAM);
  
     audioTrack.play();
     audioTrack.write(audioData, 0, bufferSizeInBytes);
  
  
    } catch (FileNotFoundException e) {
     e.printStackTrace();
    } catch (IOException e) {
     e.printStackTrace();
    }
   }
  </code></pre>
  
  <p>How can i store this clip in SDCARD? this is what i need is</p>
  
  <p>In short i need all this thing to share that changed voice clip.. how i can i do this?</p>
  
  <p>Can anybody help me to solve this problem?</p>