anchor.diff:     (status :accessor status :initform :initial :type (or :initial :open :closed))))
   
   (defun alsa-element-type (type)
  -  (cond ((eql type 'single-float) :float)
  +  (cond ((equalp type '(signed-byte 16)) :int16)
  +	((eql type 'single-float) :float)
           ((eql type 'double-float) :double)
           ((equalp type '(unsigned-byte 8)) :uint8)
           ((equalp type '(signed-byte 8)) :int8)
           ((equalp type '(unsigned-byte 16)) :uint16)
  -        ((equalp type '(signed-byte 16)) :int16)
           ((equalp type '(unsigned-byte 32)) :uint32)
           ((equalp type '(signed-byte 32)) :int32)
           (t (error "Invalid base type ~A" type))))
  
positive.code: 							  (:output :snd-pcm-stream-playback))
  					     :device device
  					     :element-type element-type
  					     :buffer (foreign-alloc (alsa-element-type element-type)
  								    :count (* (cffi:foreign-type-size (alsa-element-type element-type)) buffer-size channels-count))
  					     :buffer-size (* buffer-size channels-count) ;number of samples really
  					     :channels-count channels-count
  
negative.code: 	  (progn ,@body)
         (also-alsa:drain ,stream)
         (also-alsa:alsa-close ,stream))))
  
  (defmacro with-alsa-buffer ((buffer pcm &body body))
    `(cffi:with-pointer-to-vector-data (,buffer (buffer pcm))
       ,@body))
  
  