Android录制和播放AudioRecord和AudioTrack
package com.esa.audio; import android.media.AudioFormat; import android.media.AudioManager; import android.media.AudioRecord; import android.media.AudioTrack; import android.media.MediaRecorder; public class Audio { public static final int AUDIO_SOURCE = MediaRecorder.AudioSource.MIC; public static final int STREAM_TYPE = AudioManager.STREAM_MUSIC; public static final int SAMPLE_RATE_IN_HZ = 8000;// 44100 public static final int CHANNEL_CONFIG = AudioFormat.CHANNEL_CONFIGURATION_MONO;// AudioTrack和AudioRecord都能用 public static final int RECORD_CHANNEL_CONFIG = AudioFormat.CHANNEL_IN_MONO;