To read and decode Monkey's Audio you need to follow these steps (these steps are roughly the same as in the section dedicated to flac):
- Open an .ape file with element type
(unsigned-byte 8). - Pass the stream to
ape:open-apefunction which will create and returnbitreader:readerobject. - Read metadata blocks, passing the object from previous step to
ape:read-metadata. - Read frames with
ape:read-frame. This method accept the number of frame you wish to be read as the third argument. Total number of frames in the file can be accessed throughmetadata-total-framesfunction. - Decode the frame with
ape:decode-frameand repeat the previous step until all data is read and decoded.
API
Conditions.ape-errorGeneral APE error
metadataversionType (easy-audio.core:ub 16)Reader easy-audio.ape:metadata-versiondesc-lenType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-desc-lenheader-lenType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-header-lenseektable-lenType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-seektable-lenwavheader-lenType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-wavheader-lenaudiodata-lenType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-audiodata-lenaudiodata-len-highType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-audiodata-len-highwavtail-lenType (easy-audio.core:ub 32)Reader easy-audio.ape::metadata-wavtail-lenheader-md5Type (easy-audio.core:sa-ub 8)Reader easy-audio.ape::metadata-header-md5compression-typeType (easy-audio.core:ub 16)Reader easy-audio.ape:metadata-compression-typeformat-flagsType (easy-audio.core:ub 16)Reader easy-audio.ape::metadata-format-flagsblocks-per-frameType (easy-audio.core:ub 32)Reader easy-audio.ape:metadata-blocks-per-framefinal-frame-blocksType (easy-audio.core:ub 32)Reader easy-audio.ape:metadata-final-frame-blockstotal-framesType (easy-audio.core:ub 32)Reader easy-audio.ape:metadata-total-framesbpsType (easy-audio.core:ub 16)Reader easy-audio.ape:metadata-bpschannelsType (easy-audio.core:ub 16)Reader easy-audio.ape:metadata-channelssamplerateType (easy-audio.core:ub 32)Reader easy-audio.ape:metadata-sampleratetotal-samplesType (easy-audio.core:ub 32)Reader easy-audio.ape:metadata-total-samplesbittableType tReader easy-audio.ape::metadata-bittableseektableType (easy-audio.core:sa-ub 32)Reader easy-audio.ape::metadata-seektable
open-ape(stream)Open ape audio file and return bitreader for further operations
read-metadata(reader)Read ape metadata using
reader returned by open-aperead-frame(reader metadata n)Read the
n-th audio frame from reader. metadata is the
metadata structure for this audio file.decode-frame(frame)Decode an audio frame. Return a list of decoded channels. Each
channel is a simple array with elements of type
(signed-byte 32).with-open-ape((reader name) &body body)Open ape file with the pathname
name and creates reader
for that file. The file is closed when the control leaves body of this
macro.seconds=>frame-number(metadata seconds)Return the number of a frame whose play time is
seconds from
the beginning of file.