Package org.refcodes.audio
Enum BitsPerSample
- java.lang.Object
-
- java.lang.Enum<BitsPerSample>
-
- org.refcodes.audio.BitsPerSample
-
- All Implemented Interfaces:
Serializable
,Comparable<BitsPerSample>
public enum BitsPerSample extends Enum<BitsPerSample>
TheBitsPerSample
enumeration defines some common bits/sample per channel constants.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBitCount()
Returns the bits/sample per channel.int
getByteCount()
Returns the bytes/sample per channel.static BitsPerSample
getHigestResolution()
Retrieves the lowest bits/sample resolution.static BitsPerSample
getLowestResolution()
Retrieves the lowest bits/sample resolution.BitsPerSample
getNextHigherResolution()
Retrieves the next higher bits/sample or null if it is already the highest bits/sample.BitsPerSample
getPreviousLowerResolution()
Retrieves the previous lower bits/sample or null if it is already the lowest bits/sample.static BitsPerSample
valueOf(String name)
Returns the enum constant of this type with the specified name.static BitsPerSample[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LOW_RES
public static final BitsPerSample LOW_RES
Low resolution of 8 bits/sample and channel.
-
HIGH_RES
public static final BitsPerSample HIGH_RES
High resolution of 16 bits/sample and channel.
-
-
Method Detail
-
values
public static BitsPerSample[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BitsPerSample c : BitsPerSample.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BitsPerSample valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getBitCount
public int getBitCount()
Returns the bits/sample per channel.- Returns:
- The bits/sample for this
BitsPerSample
.
-
getByteCount
public int getByteCount()
Returns the bytes/sample per channel.- Returns:
- The bytes/sample for this
BitsPerSample
.
-
getLowestResolution
public static BitsPerSample getLowestResolution()
Retrieves the lowest bits/sample resolution.- Returns:
- The lowest resolution.
-
getHigestResolution
public static BitsPerSample getHigestResolution()
Retrieves the lowest bits/sample resolution.- Returns:
- The highest resolution.
-
getNextHigherResolution
public BitsPerSample getNextHigherResolution()
Retrieves the next higher bits/sample or null if it is already the highest bits/sample.- Returns:
- The next higher bits/sample or null if already the highest bits / sample.
-
getPreviousLowerResolution
public BitsPerSample getPreviousLowerResolution()
Retrieves the previous lower bits/sample or null if it is already the lowest bits/sample.- Returns:
- The previous lower bits/sample or null if already the lowest bits/sample.
-
-