Package ej.audio.format
Class PcmAudioFormat
- java.lang.Object
-
- ej.audio.AudioFormat
-
- ej.audio.format.PcmAudioFormat
-
public class PcmAudioFormat extends AudioFormat
AudioFormatwhich represents data with the PCM (Pulse-Code Modulation) encoding.
-
-
Constructor Summary
Constructors Constructor Description PcmAudioFormat(int sampleRate, int numChannels, int bitDepth, boolean isBigEndian, boolean isSigned)Creates a PCM audio format.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEncoding()Returns the encoding of this audio format.int[]getParameters()Returns the parameters of this audio format.
-
-
-
Constructor Detail
-
PcmAudioFormat
public PcmAudioFormat(int sampleRate, int numChannels, int bitDepth, boolean isBigEndian, boolean isSigned)Creates a PCM audio format.- Parameters:
sampleRate- the sample rate (in Hz).numChannels- the number of channels.bitDepth- the bit depth (the number of bits per sample).isBigEndian- whether the data is in big endian or in little endian.isSigned- whether the data is signed or unsigned.- Throws:
IllegalArgumentException- if the given sample rate, the given number of channels or the given bit depth is less than or equal to zero.
-
-
Method Detail
-
getEncoding
public String getEncoding()
Description copied from class:AudioFormatReturns the encoding of this audio format.- Specified by:
getEncodingin classAudioFormat- Returns:
- the encoding.
-
getParameters
public int[] getParameters()
Description copied from class:AudioFormatReturns the parameters of this audio format.The parameters depend on the encoding. The semantics of every parameter is known by the low-level audio implementation.
- Specified by:
getParametersin classAudioFormat- Returns:
- the parameters.
-
-