title: Appending Two Mp3 files in Android
body: <p>How can i append two audio files in android. I tried this but it does not work. pls  give me a soln.I need to concatenate the files from sdcard  that ts A.mp3 and B.mp3 .When i merge concatenate  method calls i want both of them as a single file in sdcard that is C.mp3........</p>
  
  <pre><code>File original= new File("/mnt/sdcard/A.mp3");
   File temp=new File("/mnt/sdcard/B.mp3");
          Log.i("...............",""+path);
  
  
          try {
              File outFile= new File("/mnt/sdcard/C.mp3 ");
  
              DataOutputStream out=new DataOutputStream(new BufferedOutputStream(new FileOutputStream(outFile)));
  
  
  
  
  
          //  FileOutputStream out=new FileOutputStream(outFile);
  
              //OutputStream out = new FileOutputStream(original,true);
  
  
              int m,n;
              m=(int) temp.length();
              n=(int) original.length();
  
               byte[] buf1 = new byte[m];
               byte[] buf2 = new byte[n];
  
               byte[] outBytes = new byte[m+n];
  
  
               DataInputStream dis1=new DataInputStream(  new BufferedInputStream(new FileInputStream(original)));
               DataInputStream dis2=new DataInputStream(  new BufferedInputStream(new FileInputStream(temp)));
  
  
  
               dis1.read(buf1, 0, m);
               dis1.close();
  
               dis2.readFully(buf2, 0, n);
               dis2.close();
  
  
               out.write(buf1);
               out.write(buf2);
              out.flush();
  
  
                  //in.close();
                  out.close();
                  System.out.println("File copied.");
  
  
          } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  </code></pre>
  
  <p>I need to combine The File A.mp3,B.mp3 to C.mp3....</p>