Class AudioAttributes
java.lang.Object
ws.schild.jave.encode.AudioAttributes
- All Implemented Interfaces:
Serializable
Attributes controlling the audio encoding process.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate IntegerThe bitrate value for the encoding process.private IntegerThe channels value (1=mono, 2=stereo) for the encoding process.private StringThe codec name for the encoding process.static final StringThis value can be setted in the codec field to perform a direct stream copy, without re-encoding of the audio stream.private IntegerThe audio quality value for the encoding process.private IntegerThe samplingRate value for the encoding process.private static final longprivate IntegerThe volume value for the encoding process. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the bitrate value for the encoding process.Returns the channels value (1=mono, 2=stereo, 4=quad) for the encoding process.getCodec()Returns the codec name for the encoding process.Returns the samplingRate value for the encoding process.Returns the volume value for the encoding process.setBitRate(Integer bitRate) Sets the bitrate value for the encoding process.setChannels(Integer channels) Sets the channels value (1=mono, 2=stereo, 4=quad) for the encoding process.Sets the codec name for the encoding process.If null or not specified the encoder will perform a direct stream copy.setQuality(Integer quality) The audio quality value for the encoding process.setSamplingRate(Integer samplingRate) Sets the samplingRate value for the encoding process.Sets the volume value for the encoding process.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
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.- See Also:
-
codec
The codec name for the encoding process. If null or not specified the encoder will perform a direct stream copy. -
bitRate
The bitrate value for the encoding process. If null or not specified a default value will be picked. -
samplingRate
The samplingRate value for the encoding process. If null or not specified a default value will be picked. -
channels
The channels value (1=mono, 2=stereo) for the encoding process. If null or not specified a default value will be picked. -
volume
The volume value for the encoding process. If null or not specified a default value will be picked. If 256 no volume change will be performed. -
quality
The audio quality value for the encoding process. If null or not specified the ffmpeg default will be used
-
-
Constructor Details
-
AudioAttributes
public AudioAttributes()
-
-
Method Details
-
getCodec
-
setCodec
Sets the codec name for the encoding process.If null or not specified the encoder will perform a direct stream copy. Be sure the supplied codec name is in the list returned byEncoder.getAudioEncoders().A special value can be picked from
DIRECT_STREAM_COPY.- Parameters:
codec- The codec name for the encoding process.- Returns:
- this instance
-
getBitRate
-
setBitRate
Sets the bitrate value for the encoding process. If null or not specified a default value will be picked.- Parameters:
bitRate- The bitrate value for the encoding process.- Returns:
- this instance
-
getSamplingRate
-
setSamplingRate
Sets the samplingRate value for the encoding process. If null or not specified a default value will be picked.- Parameters:
samplingRate- The samplingRate value for the encoding process.- Returns:
- this instance
-
getChannels
-
setChannels
Sets the channels value (1=mono, 2=stereo, 4=quad) for the encoding process. If null or not specified a default value will be picked.- Parameters:
channels- The channels value (1=mono, 2=stereo, 4=quad) for the encoding process.- Returns:
- this instance
-
getVolume
-
setVolume
Sets the volume value for the encoding process. If null or not specified a default value will be picked. If 256 no volume change will be performed.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
- Parameters:
volume- The volume value for the encoding process.- Returns:
- this instance
-
getQuality
-
setQuality
The audio quality value for the encoding process. If null or not specified the ffmpeg default will be usedThe 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
- Parameters:
quality- the audio conversion quality to set- Returns:
- this instance
-
toString
-