在android中采集音频的api是android.media.AudioRecord类
来源:互联网 发布:在职软件工程硕士2018 编辑:程序博客网 时间:2024/05/18 13:25
其中构造器的几个参数就是标准的声音采集参数
以下是参数的含义解释
public AudioRecord (int audioSource, int sampleRateInHz, int channelConfig, int audioFormat, int bufferSizeInBytes)
Since: API Level 3
Class constructor.
Parameters
audioSource
the recording source. See MediaRecorder.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等低采样率。其中44100支持所有的设备,而22050、11025、16000只支持部分设备。
channelConfig
describes the configuration of the audio channels. SeeCHANNEL_IN_MONO and CHANNEL_IN_STEREO
声道设置:android支持双声道立体声和单声道。MONO单声道,STEREO立体声
audioFormat
the format in which the audio data is represented. SeeENCODING_PCM_16BIT and ENCODING_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. See getMinBufferSize(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()查看。
采集到的数据保存在一个byteBuffer中,可以使用流将其读出。亦可保存成为文件的形式
- 在android中采集音频的api是android.media.AudioRecord类
- android中AudioRecord采集音频的参数说明
- 学习音频之android中AudioRecord采集音频的参数说明
- android中AudioRecord采集音频的参数说明以及audioTrack的播放
- Android AudioRecord 部分机型无法采集音频
- 《android多媒体api》之AudioRecord原始音频pcm录制api
- Android AudioRecord录制wav格式的音频
- Android的音频采集
- [Android] Android的音频采集
- Android Native C++ 层中使用AudioRecord录制PCM音频
- Android 音视频开发(二):使用 AudioRecord 采集音频PCM并保存到文件
- android中AudioRecord使用
- Android中AudioRecord使用
- android中AudioRecord使用
- android中AudioRecord使用
- android中AudioRecord使用
- android中AudioRecord使用
- android中AudioRecord使用
- LeetCode练习-简单卷
- [Dive into Python:]第一个 Python 程序程
- 分享:thinkphp RBAC 详解
- JAVA Jtable 添加右键菜单 参考代码
- 图形渲染CPU重要还是显卡重要?3D渲染、三维建模速度和显卡有关吗?三维制图电脑配置!3D设计用什么显卡
- 在android中采集音频的api是android.media.AudioRecord类
- SpringMVC,Mybatis,FreeMarker连接mycat示例(一)
- itoa、atoi
- 有符号数除以非-2的幂(MagicNumber为负)
- C++ getline()和get()
- 电路设计_红外遥控设计经验
- 利用map容器中统计文件中相同字符串的个数
- 3D图形渲染管线
- 深入理解ButterKnife源码并掌握原理(一)