public class AudioFormat extends Object
Constructor and Description |
---|
AudioFormat(int nBits,
double sampleRate,
int nChannels)
Construct a new audio format object with the
given number of bits and sample rate.
|
Modifier and Type | Method and Description |
---|---|
AudioFormat |
clone() |
boolean |
equals(Object obj) |
AudioFormat |
getJavaAudioFormat()
Get a Java Sound API AudioFormat object using this object's
properties.
|
int |
getNBits()
Get the number of bits in each sample.
|
int |
getNumChannels()
Get the number of channels in this format.
|
double |
getSampleRateKHz()
Get the rate at which the audio should be replayed
|
boolean |
isBigEndian()
Returns whether the data is big or little endian.
|
boolean |
isSigned()
Returns whether the data is signed or unsigned.
|
AudioFormat |
setBigEndian(boolean isBigEndian)
Set whether the data is big-endian or not.
|
AudioFormat |
setNBits(int nBits)
Sets the number of bits in this audio format.
|
AudioFormat |
setNumChannels(int nChannels)
Set the number of channels in this format.
|
AudioFormat |
setSampleRateKHz(double s)
Set the sample rate at which the audio should be replayed
|
AudioFormat |
setSigned(boolean isSigned)
Set whether the data is signed or not.
|
String |
toString() |
public AudioFormat(int nBits, double sampleRate, int nChannels)
nBits
- The number of bits in each samplesampleRate
- The sample rate in kilohertznChannels
- The number of channelspublic int getNBits()
public AudioFormat setNBits(int nBits)
nBits
- The number of bits.public double getSampleRateKHz()
public AudioFormat setSampleRateKHz(double s)
s
- The sample ratepublic AudioFormat setNumChannels(int nChannels)
nChannels
- the number of channelspublic int getNumChannels()
public AudioFormat setSigned(boolean isSigned)
isSigned
- Whether the data is signed.public boolean isSigned()
public AudioFormat setBigEndian(boolean isBigEndian)
isBigEndian
- Whether the data is big-endianpublic boolean isBigEndian()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public AudioFormat clone()
public AudioFormat getJavaAudioFormat()