                                  peaks)
     peaks))
 
+(defn extract-rms-amp
+  "Extract the RMS amplitude"
+  [wav-data block-size sample-ratio]
+  (let [rms (double-array 1)]
+    (xtract/xtract_rms_amplitude wav-data block-size (xtract-args sample-ratio) rms)
+    rms))
+
 (defn raise-errors [result]
     (cond
       (= result xtract-success)        true

        file-sample-rate     (.getSampleRate base-file-format)]
    file-sample-rate))

(defn extract-fundemental-frequency [wave-data block-size sample-rate]
    (let [r (double-array 1)]
      (xtract/xtract_wavelet_f0 wave-data block-size (xtract-args sample-rate) r)
      (first r)))

(defn extract-spectrum
  ([windowed-data block-size sample-ratio spectrum-type]
   (extract-spectrum windowed-data block-size sample-ratio spectrum-type 0.0 0.0))
  ([windowed-data block-size sample-ratio spectrum-type db-component normalised]

                                 (Integer/parseInt (format "%.0f" (/ cents 100)))
                                 0)

                      spectrum               (extract-fft-spectrum wav-data block-size SAMPLE_RATE full-window)
                      peaks                  (extract-peaks spectrum block-size SAMPLE_RATE_RATIO 10.0)
                      spectral-inharmonicity (spectral-inharmonicity peaks block-size f0 0.5 NUM_HARMONICS 0)

                      rms                    (extract-rms-amp wav-data block-size SAMPLE_RATE_RATIO)

                      spectral-irregularity (double-array [0])
                      spectral-centroid     (double-array [0])
                      spectral-variance     (double-array [0])
