public class StreamConfiguration
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BITS_PER_SAMPLE
Default sample size
|
static int |
DEFAULT_CHANNEL_COUNT
Default channel count
|
static int |
DEFAULT_MAX_BLOCK_SIZE
Default maximum block size
|
static int |
DEFAULT_MIN_BLOCK_SIZE
Default minimum block size
|
static int |
DEFAULT_SAMPLE_RATE
Default sample rate
|
static int |
MAX_BITS_PER_SAMPLE
Maximum bits per sample allowed(FLAC spec allows 32, limited to 24 here
due to limits in code)
|
static int |
MAX_BLOCK_SIZE
Maximum Block size allowed(defined by flac spec)
|
static int |
MAX_CHANNEL_COUNT
Maximum channel count allowed(defined by flac spec)
|
static int |
MAX_SAMPLE_RATE
Maximum sample rate allowed(defined by flac spec)
|
static int |
MIN_BITS_PER_SAMPLE
Minimum bits per sample allowed(defined by flac spec)
|
static int |
MIN_BLOCK_SIZE
Minimum block size allowed(defined by flac spec)
|
static int |
MIN_SAMPLE_RATE
Minimum sample rate allowed(defined by flac spec)
|
Constructor and Description |
---|
StreamConfiguration()
Constructor, sets defaults for most values.
|
StreamConfiguration(int channelCount,
int minBlock,
int maxBlock,
int sampleRate,
int bitsPerSample)
Constructor, allows setting of all options.
|
StreamConfiguration(StreamConfiguration sc)
Copy Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getBitsPerSample()
Get the number of bits per sample
|
int |
getChannelCount()
Get the currently set channel count
|
int |
getMaxBlockSize()
Get the currently set maximum block size
|
int |
getMinBlockSize()
Get the currently set minimum block size
|
int |
getSampleRate()
Get the currently set sample rate
|
boolean |
isEncodingSubsetCompliant(EncodingConfiguration ec)
Test if this StreamConfiguration and a paired EncodingConfiguration define
a Subset compliant stream.
|
boolean |
isStreamSubsetCompliant()
Test if stream is Subset compliant.
|
boolean |
isValid()
Test if the current configuration is valid.
|
boolean |
setBitsPerSample(int bitsPerSample)
Set the bits per sample.
|
boolean |
setChannelCount(int count)
Set number of channels in stream.
|
int |
setMaxBlockSize(int size)
Set the maximum block size to use.
|
int |
setMinBlockSize(int size)
Set the minimum block size to use.
|
boolean |
setSampleRate(int rate)
Set the sample rate.
|
public static final int MAX_BLOCK_SIZE
public static final int MIN_BLOCK_SIZE
public static final int MAX_CHANNEL_COUNT
public static final int MIN_SAMPLE_RATE
public static final int MAX_SAMPLE_RATE
public static final int MIN_BITS_PER_SAMPLE
public static final int MAX_BITS_PER_SAMPLE
public static final int DEFAULT_CHANNEL_COUNT
public static final int DEFAULT_MAX_BLOCK_SIZE
public static final int DEFAULT_MIN_BLOCK_SIZE
public static final int DEFAULT_SAMPLE_RATE
public static final int DEFAULT_BITS_PER_SAMPLE
public StreamConfiguration()
public StreamConfiguration(StreamConfiguration sc)
sc
- StreamConfiguration object to copypublic StreamConfiguration(int channelCount, int minBlock, int maxBlock, int sampleRate, int bitsPerSample)
channelCount
- number of channels in source audio streamminBlock
- minimum block to use in FLAC stream.maxBlock
- maximum block size to use in FLAC streamsampleRate
- sample rate in Hz of audio streambitsPerSample
- sample size of audio streampublic boolean isValid()
public boolean setChannelCount(int count)
count
- Number of channelspublic int getChannelCount()
public int getMaxBlockSize()
public int getMinBlockSize()
public int getSampleRate()
public boolean setSampleRate(int rate)
rate
- sample rate(in Hz)public int getBitsPerSample()
public boolean setBitsPerSample(int bitsPerSample)
bitsPerSample
- number of bits per samplepublic int setMaxBlockSize(int size)
size
- maximum block size to use.public int setMinBlockSize(int size)
size
- minimum block size to use.public boolean isStreamSubsetCompliant()
isEncodingSubsetCompliant
should be checked as well to ensure the combined Stream/Encoding
configurations are BOTH valid.public boolean isEncodingSubsetCompliant(EncodingConfiguration ec)
ec
- EncodingConfiguration object to check against