                       loudness              (double-array [0])
                       tonality              (double-array [0])]
 
-
-
-                  (xtract/xtract_spectral_centroid spectrum block-size (xtract-args 0.0) spectral-centroid)
-                  (xtract/xtract_irregularity_j    spectrum half-block-size nil spectral-irregularity)
+                  (raise-errors
+                   (xtract/xtract_spectral_centroid spectrum block-size (xtract-args 0.0) spectral-centroid))
+                  (raise-errors
+                   (xtract/xtract_irregularity_j    spectrum half-block-size nil spectral-irregularity))
 
                   (let [spectral-skewness      (double-array [0])
                         spectral-std-deviation (double-array [0])
                         spectral-mean          (double-array [0])
                         spectral-kurtosis      (double-array [0])]
 
-                    (xtract/xtract_spectral_mean spectrum block-size nil spectral-mean)
-                    (xtract/xtract_variance spectrum block-size (xtract-args (first spectral-mean)) spectral-variance)
-                    (xtract/xtract_spectral_standard_deviation spectrum block-size (xtract-args (first spectral-variance)) spectral-std-deviation)
+                    (raise-errors
+                     (xtract/xtract_spectral_mean spectrum block-size nil spectral-mean))
+                    (raise-errors
+                     (xtract/xtract_variance spectrum block-size (xtract-args (first spectral-mean)) spectral-variance))
+                    (raise-errors
+                     (xtract/xtract_spectral_standard_deviation spectrum block-size (xtract-args (first spectral-variance)) spectral-std-deviation))
 
                     (let [argv (xtract-args (first spectral-mean) (first spectral-std-deviation))]
-                      (xtract/xtract_spectral_skewness spectrum block-size argv spectral-skewness)
-                      (xtract/xtract_spectral_kurtosis spectrum block-size argv spectral-kurtosis))
+                      (raise-errors
+                       (xtract/xtract_spectral_skewness spectrum block-size argv spectral-skewness))
+                      (raise-errors
+                       (xtract/xtract_spectral_kurtosis spectrum block-size argv spectral-kurtosis)))
 
                     ;;(xtract/xtract_noisiness     wav-data block-size (xtract-args NUM_HARMONICS ) noiseness)
 

(def MFCC_FREQ_BANDS    13)
(def DEFAULT_BLOCK_SIZE 512)

(defn- double->clojure [vs len]
  (map-indexed
   (fn [idx v] (xtract/double_array_getitem vs idx))

         ;;  _ (xtract/int_array_setitem bark-band-limits 0 0)
         ]

     (raise-errors
      (xtract/xtract_init_mfcc half-block-size
                               (/ SAMPLE_RATE 2)
                               xtract-equal-gain
                               MFCC_FREQ_MIN
                               MFCC_FREQ_MAX
                               MFCC_FREQ_BANDS
                               (xtract_mel_filter/.getFilters mel-filters)))


     ;;public static int xtract_init_bark(int N, double sr, SWIGTYPE_p_int band_limits) {
