Skip to content
A flexible, efficient library written in Kotlin for drawing real wave forms while recording. Free, easy and convenient to use.
Kotlin Java
Branch: develop
Clone or download
Latest commit 6b88d78 Jan 14, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea up to date version Dec 17, 2019
Views Initial commit Jul 26, 2019
app up to date version Dec 17, 2019
audio implemented "Soft transition" Jan 11, 2020
gradle/wrapper up to date version Dec 17, 2019
.gitignore
LICENSE added Apache-2 license file Dec 24, 2019
README.md Update README.md Jan 14, 2020
_config.yml Set theme jekyll-theme-slate Jul 26, 2019
build.gradle up to date version Dec 17, 2019
gradle.properties Initial commit Jul 26, 2019
gradlew Initial commit Jul 26, 2019
gradlew.bat Initial commit Jul 26, 2019
settings.gradle Initial commit Jul 26, 2019

README.md

AudioRecordView

Audio visualizer that can be used during sound recording

How to include?

Add the repository to your project build.gradle:

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

And add the library to your module build.gradle:

dependencies {
  implementation 'com.github.Armen101:AudioRecordView:1.0.2'
}

Or Maven

<dependency>
  <groupId>com.github.Armen101</groupId>
  <artifactId>AudioRecordView</artifactId>
  <version>1.0.2</version>
</dependency>

How do I use AudioRecordView?

in XML

<com.visualizer.amplitude.AudioRecordView
        android:id="@+id/audioRecordView"
        android:layout_width="256dp"
        android:layout_height="64dp"
        app:chunkAlignTo="bottom"                                  
        app:chunkRoundedCorners="true"
        app:chunkSoftTransition="true"                                  
        app:chunkColor="@color/app_style_blue"
        app:chunkSpace="1dp"
        app:chunkWidth="2dp"
        app:chunkMaxHeight="48dp"
        app:chunkMinHeight="2dp"/>

Drawing

You can execute this code in a timer, for example, every 100 milliseconds

 val audioRecordView: AudioRecordView = findViewById(R.id.audioRecordView)
 
 // in the timer
 val currentMaxAmplitude = getMediaRecorder().getMaxAmplitude()
 audioRecordView.update(currentMaxAmplitude)   //redraw view

At the end or before reuse

audioRecordView.recreate()

Compatibility

Minimum Android SDK: AudioRecordView requires a minimum API level of 16.

Also you can see

Sample project in github

Tutorial in Medium

License

Apache 2.0. See the LICENSE. file for details.

Author Armen Gevorgyan

You can’t perform that action at this time.