Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5952247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:39:17+00:00 2026-05-22T17:39:17+00:00

I have recorded audio using AudioRecorder. I need to merge the recorded files into

  • 0

I have recorded audio using AudioRecorder. I need to merge the recorded files into a single file. Any suggestion.

getAudioPath() — the path of the audiofiles.
getCombineFile()— the path of the combined file. My problem is the first file alone play, not the entire file in that directory

public void readAudioAsStream()
            {
                getAudioPath();
                File f=null;
                FileInputStream ins = null;
                ReadSDDatas rds=new ReadSDDatas();
                try 
                {
                    String comfile=rds.getCombineFile();
                    //FileOutputStream fos=new FileOutputStream(comfile);
                    Log.d("combined file",comfile);
                    File file=new File(comfile);
                    RandomAccessFile raf = new RandomAccessFile(file, "rw");
                    Log.d("path size",Integer.toString(audFullPath.size()));
                    for(int i=0;i<audFullPath.size();i++)
                    {   
                        String filepath=audFullPath.get(i);
                        Log.d("Filepath",filepath);
                            f=new File(audFullPath.get(i));                                                 
                            fileContent = new byte[read];
                            ins=new FileInputStream(audFullPath.get(i));
                            int numofbytes=ins.read(fileContent);
                            System.out.println("Number Of Bytes Read===========>>>"+numofbytes);
                            raf.seek(file.length());
                            raf.write(fileContent);


                    }



                }
                catch (FileNotFoundException e1)
                {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                }
                catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

                /*String path=audFullPath.get(val);
                playAudio(path);*/
                playAudio();
                /*
                for(int i=0;i<audFullPath.size();i++)
                {
                    Log.d("fullpathsize",Integer.toString(audFullPath.size()));
                    playAudio(audFullPath.get(i));
                }*/

            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:39:18+00:00Added an answer on May 22, 2026 at 5:39 pm

    If you’re using AudioRecord.read(), I’m assuming you have the PCM data in a short or byte array. If that’s the case, all you need to do is create a new array as large as both of the originals, and copy the data over, one after the other. Something like this:

    short[] newData = new short[dataOne.length + dataTwo.length];
    for(int i=0;i<dataOne.length;i++)
        newData[i] = dataOne[i];
    for(int i=0;i<dataTwo.length;i++)
        newData[i+dataOne.length] = dataTwo[i];
    

    Then you have one array with all the PCM data, and you can do with that what you will.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to extract the audio from a FLV file recorded using FMS. I
How to save the recorded audio file which is recorded using sound_record.js from Titanium
I have written code for recording audio file using AudioRecord and while writing file
I have app in which i have recorded sound files i want that i
A few test scenarios have been recorded using CodedUI test template for my web
I have data being recorded every 15 minutes into the PowerStringHistorys and PowerCombinerHistorys tables.
I was wondering, how would I combine recorded audio and video into one if
I have been using the code in http://opensebj.blogspot.com/2009/04/naudio-tutorial-5-recording-audio.html to record audio. Basically this code:
I am trying to record audio on the Device using AVAudioRecorder. That file is
In a child activity, I record some audio using MediaRecorder and have two buttons:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.