AudioCapturePlay

Recording original PCM audio based on AudioRecord, using open source library Lame real-time conversion OF PCM audio to MP3 format audio, using Service, MediaPlayer to play MP3, recording audio timer display, audio volume decibel value display, audio spectrum display, recording, playback state control, etc

The project address

  1. Separate audio recording and playback (github.com/MannaYang/A…)
  2. Audio and video recording synthesis (github.com/MannaYang/A…)

Function introduction

Currently, it contains basic audio recording and playback operations, with the following functions:

  1. Record audio data in raw PCM format based on AudioRecord
  2. Real-time conversion of PCM audio to MP3 audio based on LAME library
  3. The corresponding SO file is compiled based on the C file in the original LAME project, providing the call LAME encoding wrapper class
  4. Format PCM data based on FFT and display audio spectrum in real time
  5. Provides recording audio timer display, volume decibel value display, recording start, pause, continue and other state control and file writing
  6. AudioPlayManager controls MediaPlayer playback, pause, continue, and Timer updates the SeekBar progress bar
  7. ObjectAnimator is provided to implement the operation of stylus, record rotation and restore animation

Other audio formats:

  1. Wav, M4A and AAC can add corresponding header files and conversion operations in the real-time callback of recording PCM format

Lame codec

  1. Lame_encode_buffer_interleaved This method is passed as a two-channel audio buffer if AudioCapture uses Audioformat.channel_in_STEREO
  2. Lame_encode_buffer This method is used for the incoming mono audio buffer if AudioCapture uses audioformat.channel_in_mono

Chronometer, RoundedBitmapDrawable control class

  1. Chronometer is a native timer that provides functions such as timing and countdown. The initial format is 00:00 and the setFormat format is 00:00:00. If you pause or continue the Chronometer, you need to subtract the timestamp
  2. RoundedBitmapDrawable can be used as a Bitmap with round corners. SetCornerRadius and setCircular are available

The public library

  1. Includes recording control class, lame codec CPP files, compile, so, the Service playback controls, use see app AudioCaptureActivity. In the class

Screenshots show

Recording start, pause, finish:

Audio file:

Play preparation:

In the play:

Thanks to the open source

  1. Audio spectrum histogram github.com/zhaolewei/M…
  2. Lame codec library sourceforge.net/projects/la…

My new personal ball

Welcome to join the planet to discuss projects, research new technologies and grow together!