public class AudioExporter extends Exporter
This class is used to export the currently loaded MIDI sequence as an audio file. Different audio formats are supported.
Modifier and Type | Field and Description |
---|---|
static int |
CHANNELS |
static int |
DEFAULT_CHANNELS |
static java.lang.String |
DEFAULT_ENCODING |
static boolean |
DEFAULT_IS_BIG_ENDIAN |
static float |
DEFAULT_SAMPLE_RATE |
static int |
DEFAULT_SAMPLE_SIZE_BITS |
static java.lang.String |
ENCODING |
static boolean |
IS_BIG_ENDIAN |
static float |
SAMPLE_RATE |
static int |
SAMPLE_SIZE_BITS |
Constructor and Description |
---|
AudioExporter()
Creates a new audio exporter.
|
Modifier and Type | Method and Description |
---|---|
ExportResult |
export(java.io.File file)
Exports an audio file.
|
private static javax.sound.sampled.AudioFormat.Encoding |
getEncoding(java.lang.String encodingStr)
Returns an encoding by a string.
|
static java.util.ArrayList<javax.sound.sampled.AudioFormat.Encoding> |
getEncodings()
Returns a list with all possible encoding formats.
|
private static javax.sound.sampled.AudioFileFormat.Type |
getFileType(java.io.File file)
Returns a file type according to the given file’s extension,
|
static java.lang.String |
getSupportedFileExtensions()
Returns a comma-separated list of all supported file extensions for audio exports.
|
static java.util.ArrayList<java.lang.String> |
getSupportedFileTypes()
Returns a list of all file types that are supported by the operating system.
|
private void |
refreshConfig()
Re-reads all config variables that are relevant for audio export.
|
createFile
public static final java.lang.String DEFAULT_ENCODING
public static final int DEFAULT_SAMPLE_SIZE_BITS
public static final float DEFAULT_SAMPLE_RATE
public static final int DEFAULT_CHANNELS
public static final boolean DEFAULT_IS_BIG_ENDIAN
public static java.lang.String ENCODING
public static int SAMPLE_SIZE_BITS
public static float SAMPLE_RATE
public static int CHANNELS
public static boolean IS_BIG_ENDIAN
public ExportResult export(java.io.File file) throws ExportException
Exports an audio file.
export
in class Exporter
file
- target audio fileExportException
- if the file can not be exported correctly.public static java.util.ArrayList<javax.sound.sampled.AudioFormat.Encoding> getEncodings()
Returns a list with all possible encoding formats.
public static java.util.ArrayList<java.lang.String> getSupportedFileTypes()
Returns a list of all file types that are supported by the operating system. Each entry contains the name of the file type and the according file extension(s).
public static java.lang.String getSupportedFileExtensions()
Returns a comma-separated list of all supported file extensions for audio exports.
private static javax.sound.sampled.AudioFormat.Encoding getEncoding(java.lang.String encodingStr)
Returns an encoding by a string.
encodingStr
- encoding string like it is used in the config fileprivate static javax.sound.sampled.AudioFileFormat.Type getFileType(java.io.File file)
Returns a file type according to the given file’s extension,
file
- the target fileprivate void refreshConfig()
Re-reads all config variables that are relevant for audio export.