public class AudioAttributes extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
DIRECT_STREAM_COPY
This value can be setted in the codec field to perform a direct stream copy, without
re-encoding of the audio stream.
|
| Constructor and Description |
|---|
AudioAttributes() |
| Modifier and Type | Method and Description |
|---|---|
Optional<Integer> |
getBitRate()
Returns the bitrate value for the encoding process.
|
Optional<Integer> |
getChannels()
Returns the channels value (1=mono, 2=stereo, 4=quad) for the encoding process.
|
Optional<String> |
getCodec()
Returns the codec name for the encoding process.
|
Optional<Integer> |
getQuality() |
Optional<Integer> |
getSamplingRate()
Returns the samplingRate value for the encoding process.
|
Optional<Integer> |
getVolume()
Returns the volume value for the encoding process.
|
AudioAttributes |
setBitRate(Integer bitRate)
Sets the bitrate value for the encoding process.
|
AudioAttributes |
setChannels(Integer channels)
Sets the channels value (1=mono, 2=stereo, 4=quad) for the encoding process.
|
AudioAttributes |
setCodec(String codec)
Sets the codec name for the encoding process.If null or not specified the encoder will perform
a direct stream copy.
|
AudioAttributes |
setQuality(Integer quality)
The audio quality value for the encoding process.
|
AudioAttributes |
setSamplingRate(Integer samplingRate)
Sets the samplingRate value for the encoding process.
|
AudioAttributes |
setVolume(Integer volume)
Sets the volume value for the encoding process.
|
String |
toString() |
public static final String DIRECT_STREAM_COPY
public Optional<String> getCodec()
public AudioAttributes setCodec(String codec)
Encoder.getAudioEncoders().
A special value can be picked from DIRECT_STREAM_COPY.
codec - The codec name for the encoding process.public Optional<Integer> getBitRate()
public AudioAttributes setBitRate(Integer bitRate)
bitRate - The bitrate value for the encoding process.public Optional<Integer> getSamplingRate()
public AudioAttributes setSamplingRate(Integer samplingRate)
samplingRate - The samplingRate value for the encoding process.public Optional<Integer> getChannels()
public AudioAttributes setChannels(Integer channels)
channels - The channels value (1=mono, 2=stereo, 4=quad) for the encoding process.public Optional<Integer> getVolume()
public AudioAttributes setVolume(Integer volume)
volume is the "amplitude ratio" or "sound pressure level" ratio 2560 is volume=20dB The formula is dBnumber=20*lg(amplitude ratio) 128 means reducing by 50% 512 means doubling the volume
volume - The volume value for the encoding process.public AudioAttributes setQuality(Integer quality)
The value depends on the choosen codec
For mp3 you can see here: https://trac.ffmpeg.org/wiki/Encode/MP3
Or more general https://ffmpeg.org/ffmpeg-codecs.html
quality - the audio conversion quality to setCopyright © 2020. All rights reserved.