Git Product home page Git Product logo

anpaudiorecorder's Introduction

ANP Audio Recorder

Introduction

ANP Audio Recorder is a library that helps a developer to provide a easy way to to user record an audio and play it to get a feedback about the record.

Screenshot

Install

Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

Step 2. Add the dependency

dependencies {
  implementation 'com.github.AgnaldoNP:ANPAudioRecorder:1.0'
}

Step 3. Add permissions

    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Usage

Sample of usage

<pereira.agnaldo.audiorecorder.AudioRecorderView
    android:id="@+id/recordView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp" />

Options

Property Value / Type
recordIcon drawable
playIcon drawable
pauseIcon drawable
stopIcon drawable
deleteIcon drawable
background drawable
baseColor color
recordIconTint color
playIconTint color
pauseIconTint color
stopIconTint color
deleteIconTint color
recordWaveTint color
playProgressTint color
backgroundTint color
timeTint color
totalTimeTint color
currentTimeTint color

These configs also can be changes at runtime by calling their set methods

Default style

Screenshot Screenshot

Screenshot Screenshot

Other Examples

GIF

<pereira.agnaldo.audiorecorder.AudioRecorderView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp"
    android:minHeight="@dimen/anp_ar_min_height"
    app:baseColor="#FF0000" />

<pereira.agnaldo.audiorecorder.AudioRecorderView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginBottom="10dp"
    android:minHeight="@dimen/anp_ar_min_height"
    app:background="@drawable/custom_bg_layout_1"
    app:baseColor="#FF0000"
    app:currentTimeTint="#F8A007"
    app:playProgressTint="#FF0"
    app:recordIconTint="#0000FF"
    app:recordWaveTint="#00FF00"
    app:totalTimeTint="#FF00FB" />

Listeners

Kotlin

recordView.setOnStartRecording {
    ...
}

recordView.setOnFinishRecord { file ->
    ...
}

recordView.setOnPlay {
    ...
}

recordView.setOnPause {
    ...
}

recordView.setOnResume {
    ...
}

recordView.setOnFinishPlay {
    ...
}

recordView.setOnDelete {
    ...
}

Java

recordView.setOnStartRecording(new AudioRecorderView.OnStartRecordingListener() {
    @Override
    public void onStartRecording() {
        ...
    }
});
// or with java 8+
recordView.setOnStartRecording(() -> {
    ...
});


recordView.setOnFinishRecord(new AudioRecorderView.OnFinishRecordListener() {
    @Override
    public void onFinishRecordListener(@NotNull File file) {
        ...
    }
});
// or with java 8+
recordView.setOnFinishRecord(file -> {
    ...
});


recordView.setOnPlay(new AudioRecorderView.OnPlayListener() {
    @Override
    public void onPlay() {
        ...
    }
});
// or with java 8+
recordView.setOnPlay(() -> {
    ...
});


recordView.setOnPause(new AudioRecorderView.OnPauseListener() {
    @Override
    public void onPause() {
        ...
    }
});
// or with java 8+
recordView.setOnPause(() -> {
    ...
});


recordView.setOnResume(new AudioRecorderView.OnResumeListener() {
    @Override
    public void onResume() {
        ...
    }
});
// or with java 8+
recordView.setOnResume(() -> {
    ...
});


recordView.setOnFinishPlay(new AudioRecorderView.OnFinishPlayListener() {
    @Override
    public void onFinishPlayListener() {
        ...
    }
});
// or with java 8+
recordView.setOnFinishPlay() -> {
    ...
});


recordView.setOnDelete(new AudioRecorderView.OnDeleteListener() {
    @Override
    public void onDelete() {
        ...
    }
});
// or with java 8+
recordView.setOnDelete() -> {
    ...
});

Contributions and Support

This project made use of NaraeAudioRecorder by WindSekirun to enable record audio functionality.

Contributions are welcome. Create a new pull request in order to submit your fixes and they shall be merged after moderation. In case of any issues, bugs or any suggestions, either create a new issue or post comments in already active relevant issues

Please consider supporting me

ETH Address

--

ETH / SHIB / BNB / SLP / IOTX / DODGE (BEP20 or ERC20)

  • 0x0d620a663692ac8797c289c5715228c5f19f9f7a

--

DOGE

  • (Main net) DQXW3DH2Jwe3zuCAcNAL7xLr1cSx7b7Pmt
  • (BEP20) 0x0d620a663692ac8797c289c5715228c5f19f9f7a

anpaudiorecorder's People

Contributors

agnaldonp avatar

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.