Spatializer.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *  3D Spatializer Class
00004  *  Header
00005  *
00006  *  Brent Lehman
00007  *  30 April 2002
00008  *
00009  *
00010  */
00011 
00012 
00013 #include "CSL_Core.h"
00014 #include "Geometer.h"
00015 
00016 
00017 namespace csl {
00018 
00019 
00020 typedef enum {
00021 
00022     POINT_DIAPHRAGM, // No HRTFs applied. Simulate a raw, ideal transducer
00023     DUMMY_HEAD, // Right ear of dummy head
00024     DUMMY_HEAD_INVERTED, // Left ear of dummy head
00025     NUM_EAR_TYPES
00026 
00027 } ear_type_t;
00028 
00029 
00030 class Spatializer
00031 {
00032 
00033     short** xfer_fxns; // An array of arrays, each array holding an HRTF
00034     int fxn_length; // assumes every HRTF has the same length
00035     int num_fxns; // number of array entries in xfer_fxns
00036     sample* ir; // the most recently calculated impulse response
00037     int ir_length; // length of ir
00038     char* kemar_path; // file system path to the KEMAR data
00039     ear_type_t ear_type; // what spatialization style to do
00040 
00041 public:
00042 
00043     Spatializer(char* pathname, ear_type_t et=DUMMY_HEAD);
00044     ~Spatializer();
00045 
00046     void spatialize_reflections(soundray* rays, int num_rays, double bleed_coeff=0.0);
00047     void spatialize_reflections(Geometer & geo, double bleed_coeff=0.0);
00048     sample* get_IR();
00049     bool get_IR(Buffer& irbuffer);
00050     int get_length();
00051 
00052     // early_late = 1: early component is at 100%, late is at 0%
00053     // early_late = 0: vice versa
00054     static bool mono_mix_early_late(Buffer& early, Buffer& late, Buffer& mix,
00055         float early_late);
00056 
00057 };
00058 
00059 }

Generated on Fri Apr 6 20:18:13 2007 for CSL by  doxygen 1.4.5-20051010