comparison org/ear.org @ 165:362bc30a3d41

cleaned up imports for hearing
author Robert McIntyre <rlm@mit.edu>
date Sat, 04 Feb 2012 03:36:48 -0700
parents c33a8e5fe7bc
children
comparison
equal deleted inserted replaced
164:c33a8e5fe7bc 165:362bc30a3d41
765 listeners at different positions in the same world. Automatically 765 listeners at different positions in the same world. Automatically
766 reads ear-nodes from specially prepared blender files and 766 reads ear-nodes from specially prepared blender files and
767 instantiates them in the world as actual ears." 767 instantiates them in the world as actual ears."
768 {:author "Robert McIntyre"} 768 {:author "Robert McIntyre"}
769 (:use (cortex world util sense)) 769 (:use (cortex world util sense))
770 (:use clojure.contrib.def)
770 (:import java.nio.ByteBuffer) 771 (:import java.nio.ByteBuffer)
771 (:import org.tritonus.share.sampled.FloatSampleTools) 772 (:import org.tritonus.share.sampled.FloatSampleTools)
772 (:import com.aurellem.capture.audio.SoundProcessor) 773 (:import (com.aurellem.capture.audio
773 (:import javax.sound.sampled.AudioFormat)) 774 SoundProcessor AudioSendRenderer))
774 775 (:import javax.sound.sampled.AudioFormat)
775 (cortex.import/mega-import-jme3) 776 (:import (com.jme3.scene Spatial Node))
776 (use 'clojure.contrib.def) 777 (:import com.jme3.audio.Listener)
778 (:import com.jme3.app.Application)
779 (:import com.jme3.scene.control.AbstractControl))
777 780
778 (defn sound-processor 781 (defn sound-processor
779 "Deals with converting ByteBuffers into Vectors of floats so that 782 "Deals with converting ByteBuffers into Vectors of floats so that
780 the continuation functions can be defined in terms of immutable 783 the continuation functions can be defined in terms of immutable
781 stuff." 784 stuff."
812 lis 815 lis
813 (.mult (.subtract new-position @old-position) 816 (.mult (.subtract new-position @old-position)
814 (float (/ tpf)))) 817 (float (/ tpf))))
815 (reset! old-position new-position))) 818 (reset! old-position new-position)))
816 (controlRender [_ _]))))) 819 (controlRender [_ _])))))
817
818 (import com.aurellem.capture.audio.AudioSendRenderer)
819 820
820 (defn create-listener! 821 (defn create-listener!
821 "Create a Listener centered on the current position of 'ear 822 "Create a Listener centered on the current position of 'ear
822 which follows the closest physical node in 'creature and 823 which follows the closest physical node in 'creature and
823 sends sound data to 'continuation." 824 sends sound data to 'continuation."