Package nzilbb.media.wav
Class ChannelExtractor
- java.lang.Object
-
- nzilbb.media.wav.ChannelExtractor
-
- All Implemented Interfaces:
MediaConverter
public class ChannelExtractor extends Object implements MediaConverter
MediaConverter that extracts a given channel from audio.- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Constructor Summary
Constructors Constructor Description ChannelExtractor()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterSetconfigure(ParameterSet configuration)Configure the converter.booleanconversionSupported(String sourceType, String destinationType)Determines whether this converter supports conversion between the given types.IntegergetChannel()Getter forchannel: Which channel to extract, e.g. 0 for left, 1 for right.ChannelExtractorsetChannel(Integer newChannel)Setter forchannel: Which channel to extract, e.g. 0 for left, 1 for right.MediaThreadstart(String sourceType, File source, String destinationType, File destination)Starts conversion.
-
-
-
Method Detail
-
getChannel
public Integer getChannel()
Getter forchannel: Which channel to extract, e.g. 0 for left, 1 for right.- Returns:
- Which channel to extract, e.g. 0 for left, 1 for right.
-
setChannel
public ChannelExtractor setChannel(Integer newChannel)
Setter forchannel: Which channel to extract, e.g. 0 for left, 1 for right.- Parameters:
newChannel- Which channel to extract, e.g. 0 for left, 1 for right.
-
configure
public ParameterSet configure(ParameterSet configuration) throws MediaException
Configure the converter. This converter requires "channel", the channel number to extract.- Specified by:
configurein interfaceMediaConverter- Parameters:
configuration- The configuration for the converter.- Returns:
- A list of configuration parameters must be set before the converter can be used.
- Throws:
MediaException- If an error occurs.
-
conversionSupported
public boolean conversionSupported(String sourceType, String destinationType) throws MediaException
Determines whether this converter supports conversion between the given types.- Specified by:
conversionSupportedin interfaceMediaConverter- Parameters:
sourceType- The MIME type of the source media.destinationType- The MIME type of the destination format.- Returns:
- true if the converter can convert from the sourceType to the destinationType, false otherwise.
- Throws:
MediaException- If an error occurs.
-
start
public MediaThread start(String sourceType, File source, String destinationType, File destination) throws MediaException
Starts conversion.- Specified by:
startin interfaceMediaConverter- Parameters:
sourceType- The MIME type of the source media.source- The source file.destinationType- The MIME type of the destination format.destination- The destination file.- Returns:
- A thread that is processing the media.
- Throws:
MediaException- If an error occurs.
-
-