Determines the type of audio file.
Determines the type of audio file.
the pathname of the file
the type code as defined in AudioFileInfo
,
e.g. TYPE_AIFF
. Returns TYPE_UNKNOWN
if the file could not be identified.
java.io.IOException
if the file could not be reader
Opens an audio file for reading.
Opens an audio file for reading.
the path name of the file
a new AudioFile
object
whose header is already parsed and can
be obtained through the spec
method.
java.io.IOException
if the file was not found, could not be reader
or has an unknown or unsupported format
Opens an audio file for reading/writing.
Opens an audio file for reading/writing. The pathname
is determined by the file
field of the provided AudioFileInfo
.
If a file denoted by this path already exists, it will be
deleted before opening.
Note that the initial audio file header is written immediately.
Special tags for the header thus need to be set in the AudioFileInfo
before calling this method, including markers and regions. It is not
possible to writer markers and regions after the file has been opened
(since the header size has to be constant).
the path name of the file.
format and resolution of the new audio file. the header is immediately written to the hard-disc
java.io.IOException
if the file could not be created or the
format is unsupported
Note that this method advances in the provided input stream, its previous position is not reset.
Note that this method advances in the provided input stream, its previous position is not reset.
The
AudioFile
allows reading and writing of sound files. It can operate both on aRandomAccessFile
created from aFile
instance, or on an kind ofInputStream
(not every codec will support this though, and functionality might be limited, for example seeking is not possible with a plainInputStream
).The codecs are registered with
AudioFileType
. The codecs that come with ScalaAudioFile are found in theimpl
package.Reading and writing data requires a user-buffer which holds de-interleaved floating point data, that is a two dimensional
Array
which holdsFloat
data. A type aliasFrames
is provided for this, and two helper methodsbuffer
: one static to construct an arbitrary user-buffer, one in classAudioFile
which creates a buffer with the appropriate channel number.the copyTo method uses a user-buffer. it should check for the possibility to directly transfer data if input and output are compatible.
AudioFileType