android中AudioRecord采集音频的参数说明
2014-07-01 12:27
344 查看
在android中采集音频的api是android.media.AudioRecord类
其中构造器的几个参数就是标准的声音采集参数以下是参数的含义解释
public AudioRecord (int audioSource, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes)
Since:API Level 3
Class constructor.
Parameters
audioSource | the recording source. SeeMediaRecorder.AudioSource for recording source definitions. 音频源:指的是从哪里采集音频。这里我们当然是从麦克风采集音频,所以此参数的值为MIC |
---|---|
sampleRateInHz | the sample rate expressed in Hertz. Examples of rates are (but not limited to) 44100, 22050 and 11025. 采样率:音频的采样频率,每秒钟能够采样的次数,采样率越高,音质越高。给出的实例是44100、22050、11025但不限于这几个参数。例如要采集低质量的音频就可以使用4000、8000等低采样率。 |
channelConfig | describes the configuration of the audio channels. SeeCHANNEL_IN_MONO andCHANNEL_IN_STEREO 声道设置:android支持双声道立体声和单声道。MONO单声道,STEREO立体声 |
audioFormat | the format in which the audio data is represented. SeeENCODING_PCM_16BIT andENCODING_PCM_8BIT 编码制式和采样大小:采集来的数据当然使用PCM编码(脉冲代码调制编码,即PCM编码。PCM通过抽样、量化、编码三个步骤将连续变化的模拟信号转换为数字编码。) android支持的采样大小16bit或者8bit。当然采样大小越大,那么信息量越多,音质也越高,现在主流的采样大小都是16bit,在低质量的语音传输的时候8bit足够了。 |
bufferSizeInBytes | the total size (in bytes) of the buffer where audio data is written to during the recording. New audio data can be read from this buffer in smaller chunks than this size. SeegetMinBufferSize(int, int, int) to determine the minimum required buffer size for the successful creation of an AudioRecord instance. Using values smaller than getMinBufferSize() will result in an initialization failure. 采集数据需要的缓冲区的大小,如果不知道最小需要的大小可以在getMinBufferSize()查看。 |
______________
// 设置线程的优先级,优先考虑最重要的音频线程。
相关文章推荐
- android中AudioRecord采集音频的参数说明
- 学习音频之android中AudioRecord采集音频的参数说明
- Android中AudioRecord采集音频
- Android AudioRecord 部分机型无法采集音频
- 音频,PCM,采样率及android的AudioRecord与AudioTrack 资料整理
- Android 使用AudioRecord录音相关和音频文件的封装
- Android多媒体音频—AudioRecord&AudioTrack
- android录音开发问题<记录1>:AudioRecord录制的音频文件如何用MediaPlayer类读取
- Android AudioRecord录音相关和音频文件的封装
- Android利用AudioRecord类实现自己的音频录制程序
- Android-->MediaMuxer,MediaCodec,AudioRecord及Camera实现音频视频混合MP4文件
- Android 使用AudioRecord录音相关和音频文件的封装
- Android多媒体学习十:利用AudioRecord类实现自己的音频录制程序
- Android Multimedia实战(六)音频 MediaRecorder和AudioRecord录音与MediaPlayer和AudioTrack播放
- Android音频处理——通过AudioRecord去保存PCM文件进行录制,播放,停止,删除功能
- Android音频处理之通过AudioRecord去保存PCM文件进行录制,播放,停止,删除功能
- Android 使用AudioRecord录音相关和音频文件的封装
- Android多媒体学习十:利用AudioRecord类实现自己的音频录制程序
- android中AudioRecord采集音频的参数说明以及audioTrack的播放
- Android多媒体学习十:利用AudioRecord类实现自己的音频录制程序