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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:42:04+00:00 2026-06-12T10:42:04+00:00

i know how to record voice as following code String path = android.os.Environment.getExternalStorageDirectory()+/Record/test.3gp; boolean

  • 0

i know how to record voice as following code

String path = android.os.Environment.getExternalStorageDirectory()+"/Record/test.3gp";



boolean exists = (new File(android.os.Environment.getExternalStorageDirectory()+"/Record/")).exists();

                if(!exists)
                {
                    newFile(android.os.Environment.getExternalStorageDirectory()+"/Record/").mkdirs();

                }



MediaRecorder recorder = new MediaRecorder();       


recorder.setAudioSource(MediaRecorder.AudioSource.MIC);

                         recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);

                recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);

                recorder.setOutputFile(path);
                try {
                    recorder.prepare();
                    recorder.start();
                } catch (IllegalStateException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }

In this code i give output path in “recorder.setOutputFile(path);” it’s work fine but my problem is if i record again it will overwrite the same path, so pls help me how to save mulitiple voice in same path in sdcard pls help me

  • 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-06-12T10:42:06+00:00Added an answer on June 12, 2026 at 10:42 am

    The file is overwritten because the MediaRecorder object gets the same output path every time. You’ll need to provide distinct names for output file each time.

    A good way can be using the date/time of the day in the filename.

    A trivial example can be:

    String path = android.os.Environment.getExternalStorageDirectory()
        + "/Record/test_" + System.currentTimeMillis() + ".3gp";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just came to know that it's possible to record call voice (both incoming
You know those movies where the tech geeks record someone's voice, and their software
I am trying to record voice in android emulator (android 4.1). But I when
Anyone know how to specify a custom record delimiter in a schema.ini file? I
I want to know how we can get record count using reference cursor in
I would like to know how I can record a video in MATLAB with
I would like to record audio to know the noise level. I do not
I would like to know how do I declare a record, that has some
I would like to know if it exist a solution to record audio which
I have done inserting a record into database but I don't know how to

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.