Easy Audio ยป Monkey's Audio

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):

  1. Open an .ape file with element type (unsigned-byte 8).
  2. Pass the stream to ape:open-ape function which will create and return bitreader:reader object.
  3. Read metadata blocks, passing the object from previous step to ape:read-metadata.
  4. 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 through metadata-total-frames function.
  5. Decode the frame with ape:decode-frame and repeat the previous step until all data is read and decoded.

API

Conditions.
ape-error
General APE error
    Metadata structure.
    metadata
    OptionValue
    Constructor:make-metadata
    Predicate:metadata-p
    Copier:copy-metadata
    • version
      OptionValue
      Type:(easy-audio.core:ub 16)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-version
      Initform:0
    • padding1
      OptionValue
      Type:(easy-audio.core:ub 16)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-padding1
      Initform:0
    • desc-len
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-desc-len
      Initform:0
    • header-len
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-header-len
      Initform:0
    • seektable-len
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-seektable-len
      Initform:0
    • wavheader-len
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-wavheader-len
      Initform:0
    • audiodata-len
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-audiodata-len
      Initform:0
    • audiodata-len-high
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-audiodata-len-high
      Initform:0
    • wavtail-len
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-wavtail-len
      Initform:0
    • header-md5
      OptionValue
      Type:t
      Read Only:nil
      Accessor:easy-audio.ape::metadata-header-md5
    • compression-type
      OptionValue
      Type:(easy-audio.core:ub 16)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-compression-type
      Initform:0
    • format-flags
      OptionValue
      Type:(easy-audio.core:ub 16)
      Read Only:nil
      Accessor:easy-audio.ape::metadata-format-flags
      Initform:0
    • blocks-per-frame
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-blocks-per-frame
      Initform:0
    • final-frame-blocks
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-final-frame-blocks
      Initform:0
    • total-frames
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-total-frames
      Initform:0
    • bps
      OptionValue
      Type:(easy-audio.core:ub 16)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-bps
      Initform:0
    • channels
      OptionValue
      Type:(easy-audio.core:ub 16)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-channels
      Initform:0
    • samplerate
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-samplerate
      Initform:0
    • total-samples
      OptionValue
      Type:(easy-audio.core:ub 32)
      Read Only:nil
      Accessor:easy-audio.ape:metadata-total-samples
      Initform:0
    • bittable
      OptionValue
      Type:t
      Read Only:nil
      Accessor:easy-audio.ape::metadata-bittable
    • seektable
      OptionValue
      Type:t
      Read Only:nil
      Accessor:easy-audio.ape::metadata-seektable
    Reading and decoding.
    open-ape(stream)
    Open ape audio file and return bitreader for further operations
    read-metadata(reader)
    Read ape metadata using reader returned by open-ape
    read-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).
    Helpers.
    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.