AudioFile
allows reading and writing of sound files. It wraps a RandomAccessFile
and delegates the I/O to subclasses which deal with the specific sample format and endianess. Currently supported formats are: AIFF, IRCAM, NeXT/Sun (.au), and WAVE. Supported resolutions are 8/16/24/32 bit integer and 32/64 bit floating point. However not all audio formats support all bit depths.
Not all format combinations are supported, for example the rather exotic little-endian AIFF, but also little-endian SND, WAVE 8-bit.
In order to simplify communication with CSound, raw output files are supported, raw input files however are not recognized.
To create a new AudioFile
you call one of its static methods openAsRead
or openAsWrite
. The format description is handled by an AudioFileDescr
object. This object also contains information about what special tags are read/written for which format. For example, AIFF can read/write markers, and application-specific chunk, and a gain tag. WAVE can read/write markers and regions, and a gain tag, etc.
The AudioFile
implements the generic interface InterleavedStreamFile
(which is likely to be modified in the future) to allow clients to deal more easily with different sorts of streaming files, not just audio files.
@author Hanns Holger Rutz
@version 0.36, 25-Feb-08
@see AudioFileDescr
@todo more flexible handling of endianess,at least SND and IRCAM should support both versions.
@todo more tags, like peak information andchannel panning.
@todo (faster) low-level direct file-to-filecopy in the copyFrames method
This is the main object manipulated by the user representing an audiofile, its properties and its tag.
The prefered way to obtain an AudioFile
is to use the AudioFileIO.read(File)
method.
The AudioFile
contains every properties associated with the file itself (no meta-data), like the bitrate, the sampling rate, the encoding infos, etc.
To get the meta-data contained in this file you have to get the Tag
of this AudioFile
This is the main object manipulated by the user representing an audiofile, its properties and its tag.
The prefered way to obtain an AudioFile
is to use the AudioFileIO.read(File)
method.
The AudioFile
contains every properties associated with the file itself (no meta-data), like the bitrate, the sampling rate, the encoding audioHeaders, etc.
To get the meta-data contained in this file you have to get the Tag
of this AudioFile
|
|