anchor.diff:                     (flex:make-flexi-stream fd :element-type 'octet)
                      nil))))
       (etypecase arg
  -      (string (make-file-stream arg))
  +      (string   (make-file-stream arg))
         (pathname (make-file-stream arg))
  -      (vector (flex:make-in-memory-input-stream arg)))))
  +      (vector   (flex:make-in-memory-input-stream arg)))))
   
   (defgeneric stream-size (stream))
   
  
positive.code: ;;; Copyright (c) 2013, Mark VandenBrink. All rights reserved.
  
  (in-package #:audio-streams)
  
  ;;;; Generic stream support
  (deftype octet () '(unsigned-byte 8))
  (deftype octets () '(simple-array octet (*)))
  (defmacro make-octets (len) `(make-array ,len :element-type 'octet))
  
  (defun make-audio-stream (arg)
    "Creates a stream for ARG"
  
negative.code:                           (setf last-byte-was-FF (= byte #xFF))))))
           (values octets size)))))
  
  ;;;; Strings: readers
  (defun stream-read-iso-string (instream &optional (len nil))
    "Read an ISO-8859-1 string of &OPTIONAL LEN.  When len is NIL,
  read in null-terminated ISO string w/o null at end"
    (declare #.utils:*standard-optimize-settings*)
  
    (let (octets)
      (if (null len)
          (setf octets
                (flex:with-output-to-sequence (out)
                  (do ((b (stream-read-u8 instream) (stream-read-u8 instream)))
                      (nil)
                    (when (zerop b)
                      (return))           ; leave loop w/o writing
                    (write-byte b out))))
          (setf octets (stream-read-sequence instream len)))
      (flex:octets-to-string octets :external-format :iso-8859-1)))
  
  (defun get-byte-order-mark (octets)
    "Get the BOM from octets"
    (declare #.utils:*standard-optimize-settings*)
  
    (let ((retval 0))
      (setf (ldb (byte 8 0) retval) (aref octets 1)
            (ldb (byte 8 8) retval) (aref octets 0))
      (when (not (or (= #xfffe retval) (= #xfeff retval)))
        (error
         "Got invalid byte-order mark of ~x in STREAM-DECODE-UCS-STRING"
         retval))
      retval))
  
  (defun stream-read-ucs-string (instream &key (len nil) (kind :ucs))
    "Read a UCS-2 string of length 'len'.  If len is nil read until we get null.
  KIND is :ucs-2, :ucs-2be or :ucs-2le.  flexi-streams doesn't appear to handle
  byte-order marks, so we have to do that here before calling."
    (declare #.utils:*standard-optimize-settings*)
  
    (let ((octets)
          (start 0))
  
      (if (null len)
          (setf octets (flex:with-output-to-sequence (out)
                         (do* ((b0 (stream-read-u8 instream)
                                   (stream-read-u8 instream))
                               (b1 (stream-read-u8 instream)
                                   (stream-read-u8 instream)))
                              (nil)
                           (when (and (zerop b0) (zerop b1))
                             (return))
                           (dbg nil 'read-ucs b0 b1)
                           (write-byte b0 out)
                           (write-byte b1 out))))
          (setf octets (stream-read-sequence instream len)))
  
      (dbg nil 'read-ucs instream kind octets)
  
      (when (eql kind :ucs-2)
        (setf start 2)
        (let ((bom (get-byte-order-mark octets)))
          (ecase bom
            (#xfffe (setf kind :ucs-2le))
            (#xfeff (setf kind :ucs-2be)))))
  
      (flex:octets-to-string octets :external-format kind :start start)))
  
  (defun stream-read-utf-8-string (instream &optional (len nil))
    "Read an UTF-8 string of length LEN.  If LEN is nil, read until we get a null."
    (declare #.utils:*standard-optimize-settings*)
  
    (let (octets)
      (if (null len)
          (setf octets (flex:with-output-to-sequence (out)
                    (do ((b (stream-read-u8 instream)
                            (stream-read-u8 instream)))
                        (nil)
                      (when (zerop b)
                        (return))
                      (write-byte b out))))
          (setf octets  (stream-read-sequence instream len)))
      (flex:octets-to-string octets :external-format :utf-8)))
  
  
  ;;;; Files
  (defvar *get-audio-info* t
  