Skip to content

Instantly share code, notes, and snippets.

View BurkeB's full-sized avatar

Bruno Burke BurkeB

  • Münster University of Applied Sciences
  • Germany
View GitHub Profile
@BurkeB
BurkeB / microphone.clj
Created October 7, 2016 19:49
Microphone Clojure test
(def audioformat (new javax.sound.sampled.AudioFormat 44100 16 2 true true))
(def info (new javax.sound.sampled.DataLine$Info javax.sound.sampled.TargetDataLine audioformat))
(if (not= (javax.sound.sampled.AudioSystem/isLineSupported info))(print "dataline not supported")(print "ok lets start\n"))
(def line (javax.sound.sampled.AudioSystem/getTargetDataLine audioformat))
(.open line audioformat)
(.start line)
(let [size (/ (.getBufferSize line) 5)
buf (byte-array size)]