cnrg.itx.datax.devices
Class AudioProperty
java.lang.Object
|
+--cnrg.itx.datax.devices.AudioProperty
- public class AudioProperty
- extends java.lang.Object
- implements Property
Class that models the properties of an audio device. This class has information
about the audio sampling rate and the sample size.
- See Also:
- Serialized Form
Field Summary |
static int |
A_LAW
|
static int |
MU_LAW
|
static int |
PCM
Some of the supported audio formats. |
Constructor Summary |
AudioProperty(int sampleRate,
int bitsPerSample,
int sampleFormat)
Creates an audioProperty. |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
PCM
public static final int PCM
- Some of the supported audio formats.
MU_LAW
public static final int MU_LAW
A_LAW
public static final int A_LAW
AudioProperty
public AudioProperty(int sampleRate,
int bitsPerSample,
int sampleFormat)
- Creates an audioProperty.
- Parameters:
sampleRate
- the rate of audio samples, in terms of bytes per secondbitsPerSample
- the number of bits that a sample contains. Typical values include 8 or 16sampleFormat
- the format of the sample (PCM, MU_LAW, A_LAW)
getSampleRate
public int getSampleRate()
- Returns the sample rate in terms of bits per second.
- Returns:
- int the sampling rate
getBitsPerSample
public int getBitsPerSample()
- Returns the number of bits that each sample contains.
- Returns:
- int the number of bits per sample
getSampleFormat
public int getSampleFormat()
- Get the format of the sample (PCM< MU_LAW, A_LAW).
- Returns:
- int the sample format
merge
public PropertiesCollection merge(PropertiesCollection pc)
throws DataException
- Merges the audio property in the property collection.
- Specified by:
- merge in interface Property
- Parameters:
pc
- the properties collection to merge the audio property with- Returns:
- PropertiesCollection the merged collection of properties
- Throws:
- DataException - thrown if there are incompatible AudioFormat objects
findOptimal
public PropertiesCollection findOptimal(PropertiesCollection pc)
throws DataException
- Finds the optimal set of properties when merging this property with a properties collection.
- Specified by:
- findOptimal in interface Property
- Parameters:
pc
- the properties collection to find the optimal properties from- Returns:
- PropertiesCollection the optimal properties collection
- Throws:
- DataException - thrown if there are incompatible AudioFormat objects
toString
public java.lang.String toString()
- Tranforms this class into
String
format.
- Returns:
- the
String
depiction of AudioProperty
- Overrides:
- toString in class java.lang.Object