Package ej.audio.format
Class PcmAudioFormat
java.lang.Object
ej.audio.AudioFormat
ej.audio.format.PcmAudioFormat
AudioFormat which represents the format of an audio sink with the PCM (Pulse-Code Modulation) encoding.-
Constructor Summary
ConstructorsConstructorDescriptionPcmAudioFormat(int sampleRate, int numChannels, int bitDepth, boolean isBigEndian, boolean isSigned) Creates a PCM audio format. -
Method Summary
Modifier and TypeMethodDescriptionReturns the data format of an audio stream.int[]Returns the parameters of this audio format.
-
Constructor Details
-
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: 8, 16, 24 or 32).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 Details
-
getEncoding
Description copied from class:AudioFormatReturns the data format of an audio stream.- Specified by:
getEncodingin classAudioFormat- Returns:
- the encoding format string.
-
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.
-