| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.sound.sampled.AudioFileFormat
public class AudioFileFormat
AudioFileFormat 类的实例描述音频文件,包括文件类型、文件长度(以字节为单位)、文件中包含的音频数据的长度(以示例帧为单位),以及音频数据的格式。
 
AudioSystem
AudioFileFormat 对象可以包括属性的集合。属性是一对键和值:键的类型是 String,其关联属性值是任意对象。属性指定其他信息元数据(如作者、版权和文件期限)。属性是可选信息,不需要文件 reader 和文件 writer 实现来提供或识别属性。
下表列出了一些应该在实现中使用的常见属性:
| 属性键 | 值类型 | 描述 | 
|---|---|---|
| “期限” | Long | 以微秒为单位的文件回放期限 | 
| “作者” | String | 此文件的作者姓名 | 
| “标题” | String | 此文件的标题 | 
| “版权” | String | 版权消息 | 
| “日期” | Date | 录制或发行日期 | 
| “注释” | String | 任意文本 | 
AudioInputStream| 嵌套类摘要 | |
|---|---|
| static class | AudioFileFormat.TypeType类的实例表示音频文件的标准类型之一。 | 
| 构造方法摘要 | |
|---|---|
|   | AudioFileFormat(AudioFileFormat.Type type,
                AudioFormat format,
                int frameLength)构造音频文件格式对象。 | 
|   | AudioFileFormat(AudioFileFormat.Type type,
                AudioFormat format,
                int frameLength,
                Map<String,Object> properties)构造具有定义的属性集合的音频文件格式对象。 | 
| protected  | AudioFileFormat(AudioFileFormat.Type type,
                int byteLength,
                AudioFormat format,
                int frameLength)构造音频文件格式对象。 | 
| 方法摘要 | |
|---|---|
|  int | getByteLength()获得以字节为单位的整个文件(不只是其音频数据)的大小。 | 
|  AudioFormat | getFormat()获得音频文件中包含的音频数据的格式。 | 
|  int | getFrameLength()获得文件中包含的音频数据的长度,以示例帧为单位表示。 | 
|  Object | getProperty(String key)获得键指定的属性值。 | 
|  AudioFileFormat.Type | getType()获得音频文件类型,如 WAVE或AU。 | 
|  Map<String,Object> | properties()获得不可修改的属性映射。 | 
|  String | toString()提供文件格式的字符串表示形式。 | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| 构造方法详细信息 | 
|---|
protected AudioFileFormat(AudioFileFormat.Type type,
                          int byteLength,
                          AudioFormat format,
                          int frameLength)
type - 音频文件的类型byteLength - 以字节为单位的文件长度,或 AudioSystem.NOT_SPECIFIEDformat - 文件中包含的音频文件的格式frameLength - 以示例帧为单位的音频数据的长度,或 AudioSystem.NOT_SPECIFIEDgetType()
public AudioFileFormat(AudioFileFormat.Type type,
                       AudioFormat format,
                       int frameLength)
type - 音频文件的类型format - 文件中包含的音频数据的格式frameLength - 以示例帧为单位的音频数据的长度,或 AudioSystem.NOT_SPECIFIED
public AudioFileFormat(AudioFileFormat.Type type,
                       AudioFormat format,
                       int frameLength,
                       Map<String,Object> properties)
type - 音频文件的类型format - 文件中包含的音频数据的格式frameLength - 以示例帧为单位的音频数据的长度,或 AudioSystem.NOT_SPECIFIEDproperties - 带属性的 Map<String,Object> 对象| 方法详细信息 | 
|---|
public AudioFileFormat.Type getType()
WAVE 或 AU。
AudioFileFormat.Type.WAVE, 
AudioFileFormat.Type.AU, 
AudioFileFormat.Type.AIFF, 
AudioFileFormat.Type.AIFC, 
AudioFileFormat.Type.SNDpublic int getByteLength()
AudioSystem.NOT_SPECIFIEDpublic AudioFormat getFormat()
public int getFrameLength()
AudioSystem.NOT_SPECIFIEDpublic Map<String,Object> properties()
类描述进一步解释。
Map<String,Object> 对象。如果不能识别任何属性,则返回空映射。getProperty(String)public Object getProperty(String key)
类描述进一步解释。
如果指定属性不是为特定文件格式定义的,则此方法返回 null。
key - 所需属性的键
null。propertiespublic String toString()
Object 中的 toString| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。