Skip to content

shelby-000/Audio-Trimmer-Android

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

INTUZ is presenting a Audio Trimmer component, which lets you trim your audio files on the fly in Android. You can record your audio and get start to trim! Please follow below steps to integrate this control in your next project.


Features

  • Ability to record your audio and trim it.
  • Ability to play selected range of audio before trimming.
  • After trimming if you don’t like the audio then you can get the original file again by pressing “Reset”.

Screenshots/audio_trimmer.png

Getting Started

How to

To get a Git project into your build:

Step 1. Add the JitPack repository to your build gradle file

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

Step 2. Add the dependency

 dependencies {
        implementation 'com.github.VishalBeepBro:Audio-Trimmer-Android:1.0'
 }

Permission and declaration in AndroidManifest.xml file

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

Declare AudioTrimmerActivity with transparent theme

    <activity
            android:name=".AudioTrimmerActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.Transparent" />

Declare transparent style in styles.xml

    <style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">false</item>
        <item name="android:backgroundDimEnabled">false</item>
    </style>

Start AudioTrimmerActivity with startActivityForResult :

    startActivityForResult(new Intent(MainActivity.this, AudioTrimmerActivity.class), 1);

Handle your onActivityResult for getting trimmed Audio Path:

    if (requestCode == 1) {
        if (resultCode == RESULT_OK) {
            if (data != null) {
                String path = data.getExtras().getString("INTENT_AUDIO_FILE");
                
            }
        }
    }

To change displayed colors

   Change declared colors in colors.xml

To modify layout of trimmer

    Modify activity_audio_trim.xml file

Bugs and Feedback

For bugs, questions and discussions please use the Github Issues.


License

Copyright (c) 2018 Intuz Solutions Pvt Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%