java mp3转m4a_轻松在你的Android App中转换音频文件,支持格式:WAV, AAC, MP3, M4A, WMA 和FLAC....

AndroidAudioConverter是一个轻量级库,用于在Android应用中轻松转换音频文件,支持AAC、MP3、M4A、WMA和WAV格式。通过在AndroidManifest.xml中添加权限并在Application类中加载库,可以实现异步音频转换。使用该库,开发者可以将FLAC文件等转换为MP3格式,并通过回调监听转换状态。
摘要由CSDN通过智能技术生成

68747470733a2f2f696d672e736869656c64732e696f2f62616467652f416e64726f6964253230417273656e616c2d416e64726f6964417564696f436f6e7665727465722d677265656e2e7376673f7374796c653d7472756568747470733a2f2f6a69747061636b2e696f2f762f61647269656c636166652f416e64726f6964417564696f436f6e7665727465722e737667

AndroidAudioConverter

Convert audio files inside your Android app easily. This is a wrapper of FFmpeg-Android-Java lib.

Supported formats:

AAC

MP3

M4A

WMA

WAV

FLAC

Lib size: ~9mb

How To Use

1 - Add this permission into your AndroidManifest.xml and request in Android 6.0+

2 - Load the lib inside your Application class

public class App extends Application {

@Override

public void onCreate() {

super.onCreate();

AndroidAudioConverter.load(this, new ILoadCallback() {

@Override

public void onSuccess() {

// Great!

}

@Override

public void onFailure(Exception error) {

// FFmpeg is not supported by device

}

});

}

}

3 - Convert audio files async

File flacFile = new File(Environment.getExternalStorageDirectory(), "my_audio.flac");

IConvertCallback callback = new IConvertCallback() {

@Override

public void onSuccess(File convertedFile) {

// So fast? Love it!

}

@Override

public void onFailure(Exception error) {

// Oops! Something went wrong

}

};

AndroidAudioConverter.with(this)

// Your current audio file

.setFile(flacFile)

// Your desired audio format

.setFormat(AudioFormat.MP3)

// An callback to know when conversion is finished

.setCallback(callback)

// Start conversion

.convert();

Import to your project

Put this into your app/build.gradle:

repositories {

maven {

url "https://jitpack.io"

}

}

dependencies {

compile 'com.github.adrielcafe:AndroidAudioConverter:0.0.8'

}

Dependencies

Want to RECORD AUDIO into your app?

Take a look at AndroidAudioRecorder! Example of usage here.

License

The MIT License (MIT)

Copyright (c) 2016 Adriel Café

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 above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值