# AudioTool<img align="right" src="https://github.com/lincollincol/AudioTool/blob/master/img/audio_tool_logo.png" width="200" height="200">
![GitHub](https://img.shields.io/github/license/lincollincol/AudioTool?style=flat-square)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/lincollincol/AudioTool?style=flat-square)
![GitHub All Releases](https://img.shields.io/github/downloads/lincollincol/AudioTool/total?color=%23ffaa&style=flat-square)
![GitHub followers](https://img.shields.io/github/followers/lincollincol?style=social)
![GitHub stars](https://img.shields.io/github/stars/lincollincol/AudioTool?style=social)
![GitHub forks](https://img.shields.io/github/forks/lincollincol/AudioTool?style=social)
AudioTool - an android library that provides useful audio processing functions. This library based on FFMPEG and uses <a href="https://github.com/tanersener/mobile-ffmpeg">mobile-ffmpeg library</a>
### AudioTool provides:
<ul>
<li> <b>Filters</b>
<ul>
<li>filterAudio(. . .)</li>
<li>removeAudioNoise(. . .) - remove noise from audio</li>
<li>normalizeAudioVolume(. . .) - normalize audio volume</li>
</ul>
</li>
<li> <b>Equalizer</b>
<ul>
<li>changeAudioBass(. . .) - reduce or increase audio bass</li>
<li>changeAudioVolume(. . .) - reduce or increase audio volume</li>
<li>changeAudioPitch(. . .) - reduce or increase audio pitch</li>
<li>changeAudioSpeed(. . .) - reduce or increase audio speed</li>
</ul>
</li>
<li> <b>Effects</b>
<ul>
<li>applyShifterEffect(. . .) - apply audio pan shifter effect</li>
<li>applyReverbEffect(. . .) - apply audio reverb effect</li>
<li>applyEchoEffect(. . .) - apply audio echo effect</li>
<li>reverseAudio(. . .) - reverse audio</li>
</ul>
</li>
<li> <b>Modificators</b>
<ul>
<li>cutAudio(. . .) - cut audio</li>
<li>convertVideoToAudio(. . .) - convert video to audio</li>
<li>joinAudios(. . .) - join few audio files to single</li>
</ul>
</li>
</li>
<li> <b>Other</b>
<ul>
<li>generateWaveform(. . .) - generate image waveform (png)</li>
<li>getMaxLevelData(. . .) - retrive audio max level data (data can be used to draw waveform)</li>
<li>getDuration(. . .) - retrive audio duration</li>
</ul>
</li>
</ul>
# Example
## Note: every function will modify previous audio.
### Input audio -> cut -> apply effect -> filter -> output audio with all these modifications
``` java
AudioTool.getInstance(this)
.withAudio(new File("/storage/emulated/0/Music/Linc - AudioTool.mp3"))
.removeVocal(new OnFileComplete() {
@Override
public void onComplete(File output) {
// Output file - audio without vocal
}
})
.applyEchoEffect(Echo.ECHO_OPEN_AIR, new OnFileComplete() {
@Override
public void onComplete(File output) {
// Output file - audio file with echo effect and without vocal
}
})
/* calls */
.release();
```
#### If you want to save current audio file state - use saveCurrentTo(path). Current audio will be saved as separate file and AudioTool continue modify input file from withAudio() parameters.
``` java
AudioTool.getInstance(this)
.withAudio(new File("/storage/emulated/0/Music/Linc - AudioTool.mp3"))
.removeVocal(output-> {/* do something with output */})
.applyEchoEffect(Echo.ECHO_OPEN_AIR, output-> {/* do something with output */})
.saveCurrentTo("/storage/emulated/0/Music/NewAudio.mp3") // Audio file with echo and without vocal
.release();
```
#### You can save audio to new file after every function call
``` java
AudioTool.getInstance(this)
.withAudio(new File("/storage/emulated/0/Music/Linc - AudioTool.mp3"))
.removeVocal(output-> {/* do something with output */})
.saveCurrentTo("/storage/emulated/0/Music/Instrumental.mp3") // Audio file without vocal
.applyEchoEffect(Echo.ECHO_OPEN_AIR, output-> {/* do something with output */})
.saveCurrentTo("/storage/emulated/0/Music/NewAudio.mp3") // Audio file with echo and without vocal
.release();
```
#### If don't need result from callbacks, you can pass null as a parameter
``` java
AudioTool.getInstance(this)
.withAudio(new File("/storage/emulated/0/Music/Linc - AudioTool.mp3"))
.removeVocal(null) // It's ok.
.saveCurrentTo("/storage/emulated/0/Music/Instrumental.mp3") // Save audio without vocal to local file
.release();
```
#### Also, don't forget to call release() function when you finish work with AudioTool. The function remove buffer files from storage and clear other resources.
``` java
AudioTool.getInstance(this)
.withAudio(new File("/storage/emulated/0/Music/Linc - AudioTool.mp3"))
/* calls */
.release(); // Always call this function
```
# FFmpeg
When you add AudioTool to your project, you also should implement <a href="https://github.com/tanersener/mobile-ffmpeg">tanersener mobile-ffmpeg library</a> which provides you full access to ffmpeg funcitons!
# Download
## Gradle
``` groovy
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```
``` groovy
dependencies {
implementation 'com.github.lincollincol:AudioTool:1.2.1'
implementation 'com.arthenica:mobile-ffmpeg-full:4.3.1.LTS'
}
```
## Maven
``` xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
```
``` xml
<dependency>
<groupId>com.github.lincollincol</groupId>
<artifactId>AudioTool</artifactId>
<version>1.2.1</version>
</dependency>
```
## Permissions
Add permissions to Manifest.xml file in your app and grant it, before using AudioTool
``` xml
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
```
## WARNING
### AudioTool process audio in the main thread ! You can run AudioTool functions with RxJava, Kotlin coroutines and Java Threads to process audio in the background therad.
AudioTool don't process audio in the background thread because of :
* You can use your own approach to work in the background thread. It makes AudioTool library more flexible.
* Reduce library size. Third-party library uses a lot of space and AudioTool delegates this task to user.
## Feedback
<a href="https://mail.google.com">linc.apps.sup@gmail.com</a>
# License
```
Copyright 2020 lincollincol
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
AudioTool - 一个 android 库,提供音频处理功能,如增加/减少速度、音高、音量、低音等。库还提供剪切、噪声消除和其他有趣和有用的功能 AudioTool 提供: 过滤器 过滤器音频(...) removeAudioNoise(. . .) - 从音频中去除噪音 normalizeAudioVolume(. . .) - 标准化音量 均衡器 changeAudioBass(. . .) - 减少或增加音频低音 changeAudioVolume(. . .) - 减少或增加音量 changeAudioPitch(. . .) - 减少或增加音频音高 changeAudioSpeed(. . .) - 降低或提高音频速度 效果 applyShifterEffect(. . .) - 应用音频平移移位器效果 applyReverbEffect(. . .) - 应用音频混响效果 applyEchoEffect(. . .) - 应用音频回声效果 reverseAudio(...) - 反向音频 修饰符 cutAudio(...) - 剪切音频 convertVideoTo
资源推荐
资源详情
资源评论
收起资源包目录
AudioTool-master.zip (55个子文件)
AudioTool-master
gradlew.bat 2KB
gradlew 5KB
gradle.properties 1KB
img
audio_tool_logo.png 17KB
.github
ISSUE_TEMPLATE
bug_report.md 834B
feature_request.md 595B
library
proguard-rules.pro 751B
src
main
assets
audiotool_ir_reverb.mp3 47KB
java
linc
com
library
FileManager.java 4KB
FFmpegNotFoundException.java 253B
FFmpegExecutor.java 2KB
Limiter.java 556B
AudioTool.java 21KB
FFmpegReflectionManager.java 3KB
Constant.java 812B
callback
OnListComplete.java 136B
OnNumberComplete.java 125B
OnFileComplete.java 145B
OnCompleteCallback.java 110B
types
Echo.java 131B
Duration.java 87B
Pitch.java 68B
AndroidManifest.xml 164B
consumer-rules.pro 0B
.gitignore 7B
build.gradle 846B
LICENSE 11KB
app
proguard-rules.pro 751B
src
main
res
mipmap-xxxhdpi
ic_launcher.png 10KB
ic_launcher_round.png 16KB
drawable
ic_launcher_background.xml 5KB
mipmap-hdpi
ic_launcher.png 4KB
ic_launcher_round.png 5KB
drawable-v24
ic_launcher_foreground.xml 2KB
values
colors.xml 208B
strings.xml 72B
styles.xml 383B
mipmap-xxhdpi
ic_launcher.png 8KB
ic_launcher_round.png 12KB
mipmap-mdpi
ic_launcher.png 3KB
ic_launcher_round.png 3KB
mipmap-xhdpi
ic_launcher.png 5KB
ic_launcher_round.png 7KB
mipmap-anydpi-v26
ic_launcher_round.xml 272B
ic_launcher.xml 272B
layout
activity_main.xml 264B
java
linc
com
audiotool
MainActivity.java 1KB
AndroidManifest.xml 1017B
.gitignore 7B
build.gradle 846B
gradle
wrapper
gradle-wrapper.jar 53KB
gradle-wrapper.properties 230B
README.md 7KB
settings.gradle 63B
build.gradle 584B
共 55 条
- 1
资源评论
- qlraishui2023-10-05资源内容总结的很到位,内容详实,很受用,学到了~
快撑死的鱼
- 粉丝: 1w+
- 资源: 9156
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功