AudioFormat
AudioFormat 用于访问 一系列语音格式和通道配置常量
例如用于AudioTrack 和AudioRecord中
The AudioFormat class is used to access a number of audio format and
* channel configuration constants. They are for instance used
* in {@link AudioTrack} and {@link AudioRecord}.
//---------------------------------------------------------
// Constants
//--------------------
/** Invalid audio data format */ 非法音频数据格式
public static final int ENCODING_INVALID = 0;
/** Default audio data format */ 默认音频数据格式
public static final int ENCODING_DEFAULT = 1;
// These two values must be kept in sync with JNI code for AudioTrack, AudioRecord
/** Audio data format: PCM 16 bit per sample. Guaranteed to be supported by devices. */ 音频数据格式 16bit取样 保证设备支持
public static final int ENCODING_PCM_16BIT = 2;
/** Audio data format: PCM 8 bit per sample. Not guaranteed to be supported by devices. */ 8bit 不保证设备支持
public static final int ENCODING_PCM_8BIT = 3;
/** Invalid audio channel configuration */
/** @deprecated use CHANNEL_INVALID instead */
@Deprecated public static final int CHANNEL_CONFIGURATION_INVALID = 0;
/** Default audio channel configuration */
/** @deprecated use CHANNEL_OUT_DEFAULT or CHANNEL_IN_DEFAULT instead */
@Deprecated public static final int CHANNEL_CONFIGURATION_DEFAULT = 1;
/** Mono audio configuration */
/** @deprecated use CHANNEL_OUT_MONO or CHANNEL_IN_MONO instead */
@Deprecated public static final int CHANNEL_CONFIGURATION_MONO = 2;
/** Stereo (2 channel) audio configuration */
/** @deprecated use CHANNEL_OUT_STEREO or CHANNEL_IN_STEREO instead */
@Deprecated public static final int CHANNEL_CONFIGURATION_STEREO = 3;
/** Invalid audio channel mask */ 不可用的音频通道
public static final int CHANNEL_INVALID = 0;
/** Default audio channel mask */ 默认音频通道
public static final int CHANNEL_OUT_DEFAULT = 1;
// Channel mask definitions below are translated to the native values defined in
// in /system/core/include/system/audio.h in the JNI code of AudioTrack
public static final int CHANNEL_OUT_FRONT_LEFT = 0x4; 前置左 0100
public static final int CHANNEL_OUT_FRONT_RIGHT = 0x8; 前置右 1000
public static final int CHANNEL_OUT_FRONT_CENTER = 0x10; 中央 10000
public static final int CHANNEL_OUT_LOW_FREQUENCY = 0x20; 低频 100000
public static final int CHANNEL_OUT_BACK_LEFT = 0x40; 后置左 1000000
public static final int CHANNEL_OUT_BACK_RIGHT = 0x80; 后置右 10000000
public static final int CHANNEL_OUT_FRONT_LEFT_OF_CENTER = 0x100; 中央前置左 100000000
public static final int CHANNEL_OUT_FRONT_RIGHT_OF_CENTER = 0x200; 中央前置右 1000000000
public static final int CHANNEL_OUT_BACK_CENTER = 0x400; 中央后置 10000000000
/** @hide */
public static final int CHANNEL_OUT_SIDE_LEFT = 0x800; 左声道
/** @hide */
public static final int CHANNEL_OUT_SIDE_RIGHT = 0x1000; 右声道
/** @hide */
public static final int CHANNEL_OUT_TOP_CENTER = 0x2000; 上中央
/** @hide */
public static final int CHANNEL_OUT_TOP_FRONT_LEFT = 0x4000; 上左前置
/** @hide */
public static final int CHANNEL_OUT_TOP_FRONT_CENTER = 0x8000; 上中央前置
/** @hide */
public static final int CHANNEL_OUT_TOP_FRONT_RIGHT = 0x10000; 上右前置
/** @hide */
public static final int CHANNEL_OUT_TOP_BACK_LEFT = 0x20000; 上左后置
/** @hide */
public static final int CHANNEL_OUT_TOP_BACK_CENTER = 0x40000; 上中后置
/** @hide */
public static final int CHANNEL_OUT_TOP_BACK_RIGHT = 0x80000; 上右后置
public static final int CHANNEL_OUT_MONO = CHANNEL_OUT_FRONT_LEFT; 单声道
public static final int CHANNEL_OUT_STEREO = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT); 立体声道
public static final int CHANNEL_OUT_QUAD = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | 四声道
CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT);
public static final int CHANNEL_OUT_SURROUND = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT | 环绕
CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_BACK_CENTER);
5.1声道是指中央声道,前置左、右声道、后置左、右环绕声道,及所谓的0.1声道重低音声道。一套系统总共可连接6个喇叭。5.1声道已广泛运用于各类传统影院和家庭影院中
public static final int CHANNEL_OUT_5POINT1 = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT |
CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_LOW_FREQUENCY | CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT);
7.1声道系统的作用简单来说就是在听者的周围建立起一套前后声场相对平衡的声场,不同于5.1声道声场的是,它在原有的基础上增加了后中声场声道,同时它也不同于普通6.1声道声场,因为7.1声道有双路后中置,而这双路后中置的最大作用就是为了防止听者因为没有坐在皇帝位而在听觉上产生声场的偏差。
public static final int CHANNEL_OUT_7POINT1 = (CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_RIGHT |
CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_LOW_FREQUENCY | CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT |
CHANNEL_OUT_FRONT_LEFT_OF_CENTER | CHANNEL_OUT_FRONT_RIGHT_OF_CENTER);
/** @hide */
public static final int CHANNEL_OUT_7POINT1_SURROUND = (
CHANNEL_OUT_FRONT_LEFT | CHANNEL_OUT_FRONT_CENTER | CHANNEL_OUT_FRONT_RIGHT |
CHANNEL_OUT_SIDE_LEFT | CHANNEL_OUT_SIDE_RIGHT |
CHANNEL_OUT_BACK_LEFT | CHANNEL_OUT_BACK_RIGHT |
CHANNEL_OUT_LOW_FREQUENCY);
注意在这里不是逻辑或||,而是按位或|,因为按之前的描述。每一种声道模式的二进制编码。1的位置都是错开的
所以进行 | 操作后。得到的就是支持的所有模式。
而其中1的位数总和。就是支持声道模式的个数
public static final int CHANNEL_IN_DEFAULT = 1;
public static final int CHANNEL_IN_LEFT = 0x4;
public static final int CHANNEL_IN_RIGHT = 0x8;
public static final int CHANNEL_IN_FRONT = 0x10;
public static final int CHANNEL_IN_BACK = 0x20;
public static final int CHANNEL_IN_LEFT_PROCESSED = 0x40;
public static final int CHANNEL_IN_RIGHT_PROCESSED = 0x80;
public static final int CHANNEL_IN_FRONT_PROCESSED = 0x100;
public static final int CHANNEL_IN_BACK_PROCESSED = 0x200;
public static final int CHANNEL_IN_PRESSURE = 0x400;
public static final int CHANNEL_IN_X_AXIS = 0x800;
public static final int CHANNEL_IN_Y_AXIS = 0x1000;
public static final int CHANNEL_IN_Z_AXIS = 0x2000;
public static final int CHANNEL_IN_VOICE_UPLINK = 0x4000;
public static final int CHANNEL_IN_VOICE_DNLINK = 0x8000;
public static final int CHANNEL_IN_MONO = CHANNEL_IN_FRONT;
public static final int CHANNEL_IN_STEREO = (CHANNEL_IN_LEFT | CHANNEL_IN_RIGHT);
AudioFormat的更多相关文章
- AudioFormat.Encoding
https://docs.oracle.com/javase/7/docs/api/javax/sound/sampled/AudioFormat.Encoding.html
- java sound初探
网上关于java sound的正规资源讲解的非常好,本文不再给出示例,主要提供一些好的资源,并说说我的一些理解,用于形成对java sound的整体认识. 一.几个词汇 TTS:text-to-spe ...
- 用ffmpeg合并音频文件
1 问题描述 打电话的对话,被拆分成了两个PCM文件.其中主叫的录音文件A.pcm,被叫的录音为B.pcm. 问题是怎么合成一个混音的对话文件AB.wav. 2 WAV文件的录音格式 常见的声音文件主 ...
- JMF框架
Java媒体框架(JMF)使你能够编写出功能强大的多媒体程序,却不用关心底层复杂的实现细节.JMF API的使用相对比较简单,但是能够满足几乎所有多媒体编程的需求.在这篇文章中,我将向你介绍如何用很 ...
- Android音频开发之AudioTrack实时播放
前言: 其实在Android中录音可以用MediaRecord录音,操作比较简单.但是不能对音频进行处理.考虑到项目中做的是实时语音只能选择AudioRecord进行录音.然后实时播放也只能采用Aud ...
- Android音频开发之AudioRecord录音实现
前言: 其实在Android中录音可以用MediaRecord录音,操作比较简单.但是不能对音频进行处理.考虑到项目中做的是实时语音只能选择AudioRecord进行录音. 本文算是对AudioRec ...
- Java中读文件操作
InputStream & Reader InputStream(字节流),如下是InputStream的层次结构: AudioInputStream:音频输入流类,该方法可以: 从外部音频文 ...
- AudioRecord类获取录音音量分贝数
转自:http://www.jb51.net/article/64806.htm public class AudioRecordDemo { private static final S ...
- AudioUnit 用法
1.描述音频单元 AudioComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentS ...
随机推荐
- 魔术师发牌问题--java实现
package com.wyl.linklist; /** **问题名称:魔术师发牌问题 *问题描述:魔术师手里一共有13张牌,全是黑桃,1~13. *********魔术师需要实现一个魔术:这是十三 ...
- tomcat配置 启动
<Context docBase="E:\apache-tomcat-7.0.50\wtpwebapps\mycms" path="" reloadab ...
- iis 设置 主机头,设置 host文件
iis主机头设置后,一般本机不能再用ip:127.0.0.1访问. 接着设置host文件,使用域名直接访问主机头就可以访问到127.0.0.1 host文件路径:c//system32/drives/ ...
- oracle管理优化必备语句以及oracle SQL语句性能调整
本文转自http://www.dataguru.cn/article-3302-1.html oracle数据库管理优化必备语句: 1. SELECT T.START_TIME,T.USED_UBLK ...
- hibernate.spring.xml
<!-- 配置数据库连接池(c3p0) --> <!-- <bean id="dataSource" class="com.mchange.v2. ...
- 剑指offer--22.反转链表
时间限制:1秒 空间限制:32768K 热度指数:440624 本题知识点: 链表 题目描述 输入一个链表,反转链表后,输出新链表的表头. /* struct ListNode { int val; ...
- python 字符串大小写相关函数
改写:(都不会改变原字符串) s = 'hEllo wOrld' s Out[3]: 'hEllo wOrld' s.upper()#全部大写 Out[4]: 'HELLO WORLD' s Out[ ...
- POJ - 1324 Holedox Moving (状态压缩+BFS/A*)
题目链接 有一个n*m(1<=n,m<=20)的网格图,图中有k堵墙和有一条长度为L(L<=8)的蛇,蛇在移动的过程中不能碰到自己的身体.求蛇移动到点(1,1)所需的最小步数. 显然 ...
- [HihoCoder1413]Rikka with String
vjudge 题意 给你一个串,问你把每个位置的字符替换成#后串中有多少本质不同的子串. \(n\le 3*10^5\) sol 首先可以计算出原串里面有多少本质不同的子串.显然就是\(\sum_{i ...
- 修改分区后的 Grub rescue
声明:这里用到的知识不是原创,综合了几篇教程的成果.找的时候比较混乱,所以来源已经不确定.希望原作者见谅. 系统是Windows 8.1 和 Ubuntu 14.04, Windows是先装的, gr ...