|
JavaTM 2 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.Type
Type 類別的實例表示音頻檔案的標準型別之一。 |
| 建構子摘要 | |
|---|---|
|
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 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。