public class Transcoder
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Attributes |
getInfo(java.lang.String file)
Returns information about an audio file: the sampling rate, the number of
channels, the decoder, ...
|
static void |
main(java.lang.String[] args) |
static void |
play(java.lang.String source) |
static void |
transcode(java.io.File source,
java.io.File target,
Attributes targetEncoding)
Transcodes audio.
|
static void |
transcode(java.io.File source,
java.io.File target,
DefaultAttributes targetEncoding)
Transcodes audio.
|
static void |
transcode(java.lang.String source,
java.lang.String target,
Attributes targetEncoding)
Transcodes audio.
|
static void |
transcode(java.lang.String source,
java.lang.String target,
DefaultAttributes targetEncoding)
Transcodes audio.
|
static boolean |
transcodingRequired(java.lang.String target,
Attributes targetEncoding)
Checks if transcoding is required: it fetches information about the file
'target' and checks if the file has the expected format, number of
channels and sampling rate.
|
public static void transcode(java.lang.String source, java.lang.String target, Attributes targetEncoding) throws EncoderException
source
- The path to the source audio file.target
- The path to the target audio file.targetEncoding
- A description of the encoding parameters.EncoderException
- If something goes wrong in the encoding process.public static void transcode(java.lang.String source, java.lang.String target, DefaultAttributes targetEncoding) throws EncoderException
source
- The path to the source audio file.target
- The path to the target audio file.targetEncoding
- A description of the encoding parameters.EncoderException
- If something goes wrong in the encoding process.public static void transcode(java.io.File source, java.io.File target, DefaultAttributes targetEncoding) throws EncoderException
source
- The path to the source audio file.target
- The path to the target audio file.targetEncoding
- A description of the encoding parameters.EncoderException
- If something goes wrong in the encoding process.public static void transcode(java.io.File source, java.io.File target, Attributes targetEncoding) throws EncoderException
source
- The path to the source audio file.target
- The path to the target audio file.targetEncoding
- A description of the encoding parameters.EncoderException
- If something goes wrong in the encoding process.public static boolean transcodingRequired(java.lang.String target, Attributes targetEncoding)
target
- the path to the transcoded file or file to transcodetargetEncoding
- The target encoding attributes. It defines the number of
channels, format, sampling rate,... the transcoded file should
have.public static Attributes getInfo(java.lang.String file)
file
- the file to get the info forpublic static void play(java.lang.String source) throws EncoderException, javax.sound.sampled.LineUnavailableException, java.io.IOException
EncoderException
javax.sound.sampled.LineUnavailableException
java.io.IOException
public static void main(java.lang.String[] args)