How to design a simple Audio Recorder App in Android Studio?

This video shows the steps to create a simple Android Audio/ Sound Recorder App using Android Studio.
This video towards the end also shows how to debug the code and build the code into APK to be able to install in your phone.
Complete Source code is available at:
programmerworld.co/android/ho...
We will be glad to hear from you regarding any query, suggestions or appreciations at: programmerworld1990@gmail.com

Пікірлер: 46

  • @sukronjazuli
    @sukronjazuli2 жыл бұрын

    sorry sir, i want to ask... How to record without sound coming out from outside? I want to record the sound of "GAME DRUM" only from inside the mobile device!!! Do you have a solution, sir... recording with clear audio without any sound from outside.. thank you 🙏 Case in point: when I want to record, my voice is not recorded automatically ... only the sound from within will appear ... this is often used by DRUM applications ...

  • @sudeshnasani3451
    @sudeshnasani3451 Жыл бұрын

    Bro, can you show the integration of ML-model that uses voice-recordings with Android-app?

  • @MyBestLife-tv5gn
    @MyBestLife-tv5gn4 жыл бұрын

    Have either of you made an audio app in FramerX?

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    No, not as of now.

  • @gradogaming4139
    @gradogaming41394 жыл бұрын

    Sir,my app works in emulator but after recording when i play the recored sound tht time wat ever i hv spoken i cant hear it and the data is always overwritten! Then when i uploaded in my old mobile which is jellybean version the recording wont work please help me with this issue

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    As I have shown in the video also, the recorded audio should play using any media player in your phone. If no sound is coming then my guess is either your mic is not working or it doesn't has the permission to access mic/audio recorder of your phone. For overwriting data issue, you can try by changing the file names and then it won't rewrite an existing file. For your actual phone with jellybean OS, do you get any issue/error message which you can share with us? Also, it is important that your App asks permission for audio recording on the first execution of this App by the user. If it is not asking then there is something missing in the code. I will suggest you to refer to my source code shown in the video from below link: programmerworld.co/android/how-to-design-a-simple-audio-recorder-app-in-android-studio/ Hope it solves the issue. Good Luck Programmer World programmerworld.co -

  • @AbhiThakur0001
    @AbhiThakur00013 жыл бұрын

    How to record audio for every 3 second and save it. I tried and audio tracks are also creating in storage like audio01 , audio02 , audio03 but the audio is saved only in audio01 . How can I solve it.

  • @ProgrammerWorld

    @ProgrammerWorld

    3 жыл бұрын

    It should work. Just make sure to update the file in the below lines of code: File file = new File(path, “/audio0X.3gp”); mediaRecorder.setOutputFile(file); Also, please ensure to call above code (that is start recording) only after the previous recording has been completely finish and below code has been executed: mediaRecorder.stop(); mediaRecorder.release(); For reference, the complete source code shown in this video is also shared in the below link: programmerworld.co/android/how-to-design-a-simple-audio-recorder-app-in-android-studio/ Cheers Programmer World programmerworld.co/ -

  • @ceydap.9457
    @ceydap.94573 жыл бұрын

    Sir, my application is not working. When I debug it goes into the try catch block in startRecording (), but it passes the catch block immediately after the first line runs. Why could this be?

  • @ProgrammerWorld

    @ProgrammerWorld

    3 жыл бұрын

    What is the exception it is throwing? Check the value of exception (e) in the catch part. It will help in searching for the solution. Cheers Programmer World programmerworld.co -

  • @manuelaha3453
    @manuelaha34534 жыл бұрын

    17:30 I am literally dying :'D. Good Job though. It helps a lot

  • @thelet3878

    @thelet3878

    3 жыл бұрын

    greattetetete

  • @keshawnthomas6946
    @keshawnthomas69465 жыл бұрын

    My saved file in the emulator will not open. It says "can't open file". Do you know why?

  • @ProgrammerWorld

    @ProgrammerWorld

    5 жыл бұрын

    Check whether the SDK level of your emulator is greater than the min SDK level of your App (you can check this in manifest file). You can also try different emulator and check. Some of the APIs may not be compliant in a specific version of Android.

  • @syedhissaan1654

    @syedhissaan1654

    5 жыл бұрын

    As mentioned in the developers documentation, MediaRecorder would work only on real devices .

  • @ihrleo
    @ihrleo2 жыл бұрын

    Hey man, do you know the code to build an app that records the screen?

  • @ProgrammerWorld

    @ProgrammerWorld

    2 жыл бұрын

    I think below page may help. Please check: programmerworld.co/android/how-to-take-screenshot-from-your-android-app-and-open-the-image-file-programmatically/ Cheers Programmer World programmerworld.co/ -

  • @LastOneStandingg
    @LastOneStandingg3 жыл бұрын

    When we create or record new file is not generated it replaces the previous one? Why the new file is not created every time? please ans my question?

  • @ProgrammerWorld

    @ProgrammerWorld

    3 жыл бұрын

    Because in the code the file name is hard coded as below: File path = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS); File file = new File(path, “/KZreadAudio.3gp”); To get a new file name on each run, then take a dynamic file name in the above. That is, either get the file name from the user using an EditText box in the layout. Or dynamically update the file name - say file name will be the current date and time stamp. Hope above helps. The complete source code shown in this video is also shared in the below link for reference: programmerworld.co/android/how-to-design-a-simple-audio-recorder-app-in-android-studio/ Cheers Programmer World programmerworld.co/ -

  • @AbhiThakur0001

    @AbhiThakur0001

    3 жыл бұрын

    You should save it by getting the save time .

  • @neeraj_v7070
    @neeraj_v70704 жыл бұрын

    i have double , can't it run on marshmallow (API 6.0) it was showing api problem it show "unfortunately audio recoder is stoped" massage when i press start or stop, please help me

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    AFAIK it should work in marshmallow also (API 23). Minor adaptation of the API might be required when we change the API levels but otherwise this tutorial should work in API level 23. I will suggest you to put try-catch to do the error handling in your start/ stop method. This will ensure that the App doesn't crashes/ closes abruptly and you can do specific operations when the Exception is thrown. For reference, the complete source code of this tutorial is shared at the below link: programmerworld.co/android/how-to-design-a-simple-audio-recorder-app-in-android-studio/ Good Luck Programmer World programmerworld.co -

  • @neeraj_v7070

    @neeraj_v7070

    4 жыл бұрын

    @@ProgrammerWorld mediaRecorder.setOutputFile(file); at this statement it was showing error and asking for 26 api

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    @@neeraj_v7070 Yes, checking the Android developer portal it says that API level 26 is needed for setoutputFile(File file) method. See the link below: developer.android.com/reference/android/media/MediaRecorder#setOutputFile(java.io.File) I will suggest to use other method of setoutputFile method. Like public void setOutputFile (String path) Link: developer.android.com/reference/android/media/MediaRecorder#setOutputFile(java.lang.String) Good Luck Programmer World programmerworld.co -

  • @animeuniverse4585
    @animeuniverse45853 жыл бұрын

    when I click the stop button it is crashing what to do?

  • @ProgrammerWorld

    @ProgrammerWorld

    3 жыл бұрын

    Quick action would be to encapsulate the stop button onClick method with try-catch and check the exception being thrown. The other option would be to debug the code and check for the error it throws at the step it crashes. Please post the error message you are getting which will help to get a solution. Cheers Programmer World programmerworld.co -

  • @yousefshora9821
    @yousefshora98214 жыл бұрын

    i'm getting errors can u please help me

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    What is the error you are observing? Can you please copy the error text here. Good Luck Programmer World programmerworld.co -

  • @MrLachek
    @MrLachek5 жыл бұрын

    The Second time I try to start recording I have to restart app Edit: Solution: copy paste: mediaRecorder = new MediaRecorder(); into startRecording function

  • @ProgrammerWorld

    @ProgrammerWorld

    5 жыл бұрын

    Thanks for posting the solution.

  • @anasfarhad2845
    @anasfarhad28454 жыл бұрын

    App working properly but there is no sound. Need help

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    In the video to play the audio I have used in-built audio player of the phone. So, if the sound is not coming then very likely there are 2 reasons: - Either the speaker volume is 0 or mute in your phone or audio player. Please check that. - Else during recording mic of your phone is mute or not accessible to the App. Please check. As long as audio file is getting created I can't think of any other reason of why the sound shouldn't work. Good Luck Programmer World programmerworld.co -

  • @anasfarhad2845

    @anasfarhad2845

    4 жыл бұрын

    Programmer World no no i have built the app but my microphone is not recording the audio thats the reason i was asking. Thanks for the reply

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    @@anasfarhad2845 Then that implies that your App doesn't have access to your mic. Make sure to grant record audio permission to your App. For source code you can refer to below webpage: Good Luck Programmer World programmerworld.co -

  • @anasfarhad2845

    @anasfarhad2845

    4 жыл бұрын

    Programmer World ok Thanks for reply. I Really appreciate it

  • @samuelokungbowa8240
    @samuelokungbowa82404 жыл бұрын

    pls be uploading your code to github

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    Hi Samuel, Thanks for your suggestion. I will upload my code and projects on GitHub.

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    You can find the source code in the below link: programmerworld.co/android/how-to-design-a-simple-audio-recorder-app-in-android-studio/ -

  • @734_sonaligupta9
    @734_sonaligupta94 жыл бұрын

    Sir it's not ckear

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    I assume you mean either audio or the display is not clear of the video. I checked it out and it seems to be very clear to me. Try running it in HD mode. Alternatively, if you meant the concept explained in the video is not clear then please let me know if you have any specific questions and I will be happy to check them out.

  • @734_sonaligupta9
    @734_sonaligupta94 жыл бұрын

    Make it clear

  • @ProgrammerWorld

    @ProgrammerWorld

    4 жыл бұрын

    Video is very clear in HD mode. Please refer to my earlier comment for details.

Келесі