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 6877503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:36:29+00:00 2026-05-27T04:36:29+00:00

All , I am using Media Recorder for Recording Audio . Case 1: If

  • 0

All , I am using Media Recorder for Recording Audio.

Case 1: If i use Android Version 2.2 installed devices, my recorded audio combined and playing well.

Case 2: If i use it in Android 1.6 installed devices, i am not able to play the combined audio file.

It is playing only the very first recorded audio and next recorded audio files keep empty no sound.

Also i am not getting any error in Logcat.

I used following code for recording audio :

    mRecorder = new MediaRecorder();
    mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
    mRecorder.setOutputFormat(MediaRecorder.OutputFormat.RAW_AMR);
    mRecorder.setOutputFile(main_record_file);
    mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
    mRecorder.prepare();
    mRecorder.start();

Also i tried for mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);

Code for combining Audio file :

    public void createCombineRecFile(){
    combined_file_stored_path=getFilename_combined_raw(); // File path in String to store recorded audio
    byte fileContent[]=null;
    FileInputStream ins;
    FileOutputStream fos = null;
    try{
        fos = new FileOutputStream(combined_file_stored_path,true);
    }
    catch (FileNotFoundException e1){
        // TODO Auto-generated catch block
        e1.printStackTrace();
    }
    for(int i=0;i<audNames.size();i++){
        try{
            File f=new File(audNames.get(i));
            Log.v("Record Message", "File Length=========>>>"+f.length());
            fileContent = new byte[(int)f.length()];
            ins=new FileInputStream(audNames.get(i));
            int r=ins.read(fileContent);// Reads the file content as byte from the list.
            Log.v("Record Message", "Number Of Bytes Readed=====>>>"+r);
            fos.write(fileContent);//Write the byte into the combine file.

            Log.v("Record Message", "File======="+i+"is Appended");

        }
        catch (FileNotFoundException e){
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        catch (IOException e) 
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    try{
        fos.close();
        Log.v("Record Message", "===== Combine File Closed =====");
    }
    catch (IOException e){
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}

Let me know any details need.Thanks.

  • 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-27T04:36:30+00:00Added an answer on May 27, 2026 at 4:36 am

    Every audio file has its own header (includes information about length/samples etc.) – by combining the files the way you do the resulting file has multiple headers, one per source file (depending on the exact format with file offsets etc.).
    Thus the resulting file is NOT correct in terms of file format spec.

    The newer Android version are more permissive and work/play with “multiple headers” present… the older versions do not…

    To create a correctly combined audio file you must conform to the spec which among other things means creating one new header which describes all included audio…

    Use for the the combination of audio files a different approach – for example via ffmpeg (see this for how to make ffmpeg for android).

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

Sidebar

Related Questions

I am using media element to render video in WPF. All videos are working
I am using this feed http://feeds.bbci.co.uk/news/rss.xml and want to get all media:thumbnail entries. I.e.
I'm using the Windows API to get audio input. I've followed all the steps
I am using the Media Plugin (http://www.ohloh.net/p/cakephp-media). I wanna define custom folder for all
I am looking at using CSS Media Query to support multiple tablets (Android/iPad). Below
I see some using only screen in the media queries, others using all, others
Once I run search all using Ctrl + Shift + F then my search
Possible Duplicate: Should Usings be inside or outside the namespace sa1200 All using directives
We have a large number of programmers on different platforms all using CVS. We
I'm using all of them to print the names of assigned IANA values in

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.