All Projects → WindSekirun → NaraeAudioRecorder

WindSekirun / NaraeAudioRecorder

Licence: Apache-2.0 License
AudioRecorder for Android powered by Kotlin

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to NaraeAudioRecorder

Ffmpeg Android Java
FFmpeg Android java is a java library that simplifies your task of using ffmpeg in Android project which I've compiled using FFmpeg-Android
Stars: ✭ 3,098 (+3678.05%)
Mutual labels:  ffmpeg, ffmpeg-android
Android Video Trimmer
Android-Video-Trimmer项目实现了对长短视频进行片段的裁剪选择。使用MediaMetadataRetriever获取视频帧,采用ffmpeg进行视频裁剪,和视频压缩。
Stars: ✭ 824 (+904.88%)
Mutual labels:  ffmpeg, ffmpeg-android
Ffmpeg Video Editor Android
Sample android project using ffmpeg for cutting and compressing video,reversing video,extracting image frames from video,extracting audio from video,add fade in fade out effect,create fast and slow motion video
Stars: ✭ 414 (+404.88%)
Mutual labels:  ffmpeg, ffmpeg-android
Rxffmpeg
🔥💥RxFFmpeg 是基于 ( FFmpeg 4.0 + X264 + mp3lame + fdk-aac + opencore-amr + openssl ) 编译的适用于 Android 平台的音视频编辑、视频剪辑的快速处理框架,包含以下功能:视频拼接,转码,压缩,裁剪,片头片尾,分离音视频,变速,添加静态贴纸和gif动态贴纸,添加字幕,添加滤镜,添加背景音乐,加速减速视频,倒放音视频,音频裁剪,变声,混音,图片合成视频,视频解码图片,抖音首页,视频播放器及支持 OpenSSL https 等主流特色功能
Stars: ✭ 3,358 (+3995.12%)
Mutual labels:  ffmpeg, ffmpeg-android
Ffmpeg Android Maker
Contains a script that assembles FFmpeg library for Android
Stars: ✭ 207 (+152.44%)
Mutual labels:  ffmpeg, ffmpeg-android
Ffmpegandroid
最新版ffmpeg3.3-android,并通过CMake方式移植到Android中,并实现编解码,转码,推拉流,滤镜等各种功能
Stars: ✭ 526 (+541.46%)
Mutual labels:  ffmpeg, ffmpeg-android
Ffmpeg Android
FFMpeg/FFprobe compiled for Android
Stars: ✭ 592 (+621.95%)
Mutual labels:  ffmpeg, ffmpeg-android
Bzijkplayer
基于cmake构建的ijkPlayer
Stars: ✭ 23 (-71.95%)
Mutual labels:  ffmpeg, ffmpeg-android
Kotlinffmpeg
Examples of using FFMpeg library on Android with Kotlin
Stars: ✭ 138 (+68.29%)
Mutual labels:  ffmpeg, ffmpeg-android
Ffmpegandroidlibrary
One line integration for FFMPEG Library in Android
Stars: ✭ 88 (+7.32%)
Mutual labels:  ffmpeg, ffmpeg-android
Fanplayer
A portable video player based on ffmpeg for windows and android platform.
Stars: ✭ 229 (+179.27%)
Mutual labels:  ffmpeg, ffmpeg-android
Ffplayer
a video player based on ffmpeg for win32 and android platform.
Stars: ✭ 210 (+156.1%)
Mutual labels:  ffmpeg, ffmpeg-android
FFmpeg-3.4-Android
This repository helps to compile FFmpeg 3.4 Version for Android using Android NDK Standalone Toolchain.
Stars: ✭ 23 (-71.95%)
Mutual labels:  ffmpeg, ffmpeg-android
canvas-capture
Record the canvas as an image, mp4 video, or gif from the browser
Stars: ✭ 35 (-57.32%)
Mutual labels:  ffmpeg
Vienna
Vienna 是一款安卓音频操作工具,主要提供音频录制与播放的功能。提供简洁的接口降低音频开发的成本。
Stars: ✭ 43 (-47.56%)
Mutual labels:  audio-recorder
PyroGramBot
pluggable Telegram Bot based on Pyrogram
Stars: ✭ 168 (+104.88%)
Mutual labels:  ffmpeg
AudioManager
这是一个 Android 端万能音频播放器,只要给我一个路径我就能进行播放。
Stars: ✭ 26 (-68.29%)
Mutual labels:  ffmpeg
dji-ryze-tello
Pythonic DJI Ryze Tello Workbench
Stars: ✭ 17 (-79.27%)
Mutual labels:  ffmpeg
p5.rec
🍿 p5.rec lets you record your p5.js sketches and convert them to mp4 in your browser ▶️
Stars: ✭ 70 (-14.63%)
Mutual labels:  ffmpeg
YKAVStudyPlatform
ffmpeg、ffplay、ffprobe 调试环境搭建,个人音视频全平台学习记录
Stars: ✭ 23 (-71.95%)
Mutual labels:  ffmpeg

NaraeAudioRecorder

Download Android Arsenal

AudioRecorder for Android powered by Kotlin.

Key Features

  • Easy to use API
  • Record on various format
    • core: pcm, wav
    • ffmpeg-recorder: mp3, m4a, wma, flac, aac
  • Pause & Resume recording
  • Integrated timer is provide maxAvailableTime feature
  • Remove background noise using NoiseSuppressor API
  • 100% write in Kotlin, but has Java Compatible
  • Detect amount of time of Silent

Import

It distributed on JCenter, but sometime it's not available.

repositories {
    maven { url "https://dl.bintray.com/windsekirun/maven/" }
}

Core

Core module will contain most feature and two format. 'pcm' and 'wav'

implementation 'com.github.WindSekirun.NaraeAudioRecorder:core:1.3.0'

FFmpeg-Recorder

FFmpeg-Recorder will contain five format, 'mp3', 'm4a', 'wma', 'flac', 'aac'

This module will increase Final APK Size about 20MB. You can reduce APK Size by this guide

implementation 'nl.bravobit:android-ffmpeg:1.1.5'
implementation 'com.github.WindSekirun.NaraeAudioRecorder:ffmpeg-recorder:1.3.0'

Usages

Core

Initialization

 val audioRecorder = NaraeAudioRecorder()
 val destFile = File(Environment.getExternalStorageDirectory(), "/NaraeAudioRecorder/$fileName$extensions")
 audioRecorder.create() {
            this.destFile = destFile
 }

Define instance of 'NaraeAudioRecorder' and create file and provide with NaraeAudioRecorder.create is fine.

If you want use NoiseSuppressor, define instance of NoiseAudioSource and provide with NaraeAudioRecorder.create.

val recordConfig = AudioRecordConfig.defaultConfig()
val audioSource = NoiseAudioSource(recordConfig)
audioRecorder.create() {
          this.destFile = this.destFile
          this.recordConfig = recordConfig
          this.audioSource = audioSource
}

Initialization in Java

This is full sample of 'initialization in Java'. other feature is same.

File destFile = new File(getContext().getExternalFilesDir(null) + String.format("/recorder/%s.mp3", fileName));
destFile.getParentFile().mkdirs();

mAudioRecorder.checkPermission(getContext());
mAudioRecorder.create(FFmpegRecordFinder.class, config -> {
    config.setDestFile(destFile);
    config.setDebugMode(true);
    config.setTimerCountListener((currentTime, maxTime) -> { 
    });
            
    return null;
});

FFmpegAudioRecorder ffmpegAudioRecorder = (FFmpegAudioRecorder) mAudioRecorder.getAudioRecorder();
ffmpegAudioRecorder.setContext(getContext());
ffmpegAudioRecorder.setOnConvertStateChangeListener(state -> {
    if (state == FFmpegConvertState.SUCCESS) {
        mRecordedPath = destFile.getPath();
    }
});

Permission

Starting from 1.2.0, if permission isn't granted, NaraeAudioRecorder will throw RuntimeException.

  • RECORD_AUDIO
  • WRITE_EXTERNAL_STORAGE
  • READ_EXTERNAL_STORAGE

So make sure grant proper permissions before using startRecording function.

Start / Stop / Pause / Resume

audioRecorder.startRecording(Context)
audioRecorder.stopRecording()
audioRecorder.pauseRecording()
audioRecorder.resumeRecording()

Custom config of AudioRecord

You can custom config of AudioRecord with AudioRecordConfig

fun defaultConfig() = AudioRecordConfig(MediaRecorder.AudioSource.MIC,
                AudioFormat.ENCODING_PCM_16BIT,
                AudioFormat.CHANNEL_IN_MONO,
                AudioConstants.FREQUENCY_44100)

Listen about state changes of record

audioRecorder.setOnRecordStateChangeListener(OnRecordStateChangeListener)

Set maxAvailableTime & Listen about changes of timer

audioRecorder.create(FFmpegRecordFinder::class.java) {
          ...
          this.maxAvailableMillis = TimeUnit.SECONDS.toMillis(20)
          this.timerCountListener = { currentTime, maxTime -> }
}

If you want use accuracy, define refreshTimerMillis in create section will be help for you. Default is 50.

FFmpeg-recorder

Using FFmpeg-recorder will need some additional info.

audioRecorder.create(FFmpegRecordFinder::class.java) {
            this.destFile = this.destFile
            this.recordConfig = recordConfig
            this.audioSource = audioSource
}

val ffmpegAudioRecorder: FFmpegAudioRecorder = audioRecorder.getAudioRecorder() as? FFmpegAudioRecorder ?: return
ffmpegAudioRecorder.setContext(this)

In parameters of create, use FFmpegRecordFinder::class.java to determine proper recorder with destFile .

FFmpeg-recorder uses WavAudioRecorder internally, recording in wav and convert them to desire format using FFmpeg command.

Change config of FFmpeg

You can custom config of FFmpeg using this options.

ffmpegAudioRecorder.setConvertConfig(FFmpegConvertConfig)

Default value is fun defaultConfig() = FFmpegConvertConfig(bitRate = FFmpegBitRate.def, samplingRate = FFmpegSamplingRate.ORIGINAL, mono = true).

Listen about state changes of convert

ffmpegAudioRecorder.setOnConvertStateChangeListener(OnConvertStateChangeListener)

Sample Application

Code

License

Core

Copyright 2019, WindSekirun (DongGil, Seo)

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.

FFmpeg-recorder

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].