Git Product home page Git Product logo

pauseresumeaudiorecorder's Introduction

PauseResumeAudioRecorder

This library provides a .WAV recorder that can be paused and resumed. The current Android media recorder does not support pause/resume functionality (http://developer.android.com/reference/android/media/MediaRecorder.html), so this was created.

How to Pull into your Project

Put "compile 'com.github.republicofgavin:pauseresumeaudiorecorder:1.0'" in your projects dependency section of your build.gradle.

Licensing

This project uses the Apache License.

Tech Design

The recorder uses the AudioRecord Android object to do its recording. Once recording begins, a thread is created which dumps the audio data into a temporary PCM file. If the recorder is paused during this workflow, the thread just sleeps until resume/stop are entered. Once the user calls stop, the thread converts the PCM file into the specified WAV file. If an error occurs during this process, the state of the media recorder is set to a error state(defined in the media recorder file). Once the media recorder has been stopped, it can't be reused. Thus, you should create a new instance and use that one.

pauseresumeaudiorecorder's People

Contributors

gavin avatar republicofgavin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pauseresumeaudiorecorder's Issues

how to get duration of record file?

hi, i'm using your code in my project and it work quite well, but when i toggle pauseRecording|resumeRecording many times ( about 2 or 3 times per second ), audio length is a bit longer, how to get total audio length?

i have a function to get duration but it not work on above case:

public int getCurrentRecordDuration() {
        return Math.round((maxTimeInMillis - remainingMaxTimeInMillis) / 1000f);
}

Remove last 1 second of record

Hi again :)

It could be that you won't be able to help me with this, but I will try to ask you :) Maybe you know how to remove last second of record when we tap on stop button? Because I have some issue. When we click on stop button very loudly it hearly on the record on last second. Can we remove this last second? Or maybe make less sesitivity of microphone?

Thank you advance!

Library doesn't record

I start recording like this

String audio = Environment.getExternalStorageDirectory() + "/record_" + recordsListView.getSectionType();
mediaRecorder = new PauseResumeAudioRecorder();
mediaRecorder.setAudioFile(audio);
mediaRecorder.startRecording();

and then I trying to listen it in VLC player, and it' doesn't work... What problem could be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.