|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.audio.Format
public class Format
This class is used for file type determination, and file conversion
| Nested Class Summary | |
|---|---|
static interface |
Format.Errors
|
static interface |
Format.RecordType
Format.Type.WAV is the same as Format.RecordType.WAV for backward compatibility |
static interface |
Format.Type
Supported audio types are Format.Type |
| Field Summary | |
|---|---|
static int |
DEFAULT_AMR_ENCODE_RATE
default encode rate for AMR. |
| Constructor Summary | |
|---|---|
Format()
|
|
| Method Summary | |
|---|---|
static boolean |
canTranslate(int sourceType,
int destType)
Pass in a Format.Type.* for sourceType and destType. |
static boolean |
canTranslate(int sourceType,
int destType,
int destEncodeRate)
|
static String |
determineMimeType(byte[] data)
Given at least 4 bytes of header from a file, determine if its a valid file and return its MIME type as a String. |
static int |
determineType(byte[] data)
Given at least 4 bytes of header from a file, determine if its a valid file and return its type as one of Format.Type. |
static int |
determineType(File file)
Given a file, determine if it is a valid file and return its type as one of Format.Type. |
static int |
determineTypeFromResource(int id,
Application app)
Given a resource ID, walk through the application resource file, then the system resource file looking for a sequence then a sound, and return a Format.Type.* value |
static int |
getDefaultEncodeRate(int type)
Return default encode rate for passed in audio type |
static Metatag |
getMetaInfo(File file)
|
static String[] |
getMimeTypes()
Return a String [] with all supported device MIME types. |
static int |
getSoundProperties(byte[] data,
SoundProperties input)
|
static boolean |
isTypeFileStreamable(int type)
Pass in a Format.Type.* and this will return true if this format can stream with the Stream object - use with file based objects |
static boolean |
isTypeSequence(int type)
Pass in a Format.Type.* and this will return true if it is a Sequence object |
static boolean |
isTypeSound(int type)
Pass in a Format.Type.* and this will return true if it is a Sound object |
static boolean |
isTypeStreamable(int type)
Pass in a Format.Type.* and this will return true if this format can stream with the Stream object - use with memory based objects |
static byte[] |
translate(int sourceType,
byte[] sourceData,
int destType,
int destEncodeRate)
Start an synchronous translation of sourceType file into destType if possible. |
static int |
translateProgress()
If a translation is in progress, return percentage finished 0 to 100 |
static int |
translateStart(int sourceType,
byte[] sourceData,
int destType,
int destEncodeRate,
Event complete,
Event failed)
Start an asynchronous translation of sourceType file into destType if possible. |
static void |
translateStop()
Stop current translation if in progress |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_AMR_ENCODE_RATE
| Constructor Detail |
|---|
public Format()
| Method Detail |
|---|
public static String determineMimeType(byte[] data)
public static String[] getMimeTypes()
public static int determineType(byte[] data)
public static int determineType(File file)
public static Metatag getMetaInfo(File file)
public static boolean isTypeFileStreamable(int type)
public static boolean isTypeStreamable(int type)
public static boolean isTypeSound(int type)
public static boolean isTypeSequence(int type)
public static int determineTypeFromResource(int id,
Application app)
public static int getSoundProperties(byte[] data,
SoundProperties input)
public static int getDefaultEncodeRate(int type)
public static boolean canTranslate(int sourceType,
int destType)
public static boolean canTranslate(int sourceType,
int destType,
int destEncodeRate)
public static byte[] translate(int sourceType,
byte[] sourceData,
int destType,
int destEncodeRate)
public static int translateStart(int sourceType,
byte[] sourceData,
int destType,
int destEncodeRate,
Event complete,
Event failed)
public static void translateStop()
public static int translateProgress()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||