38 using namespace Nsound;
43 #define CERR_HEADER __FILE__ << ":" << __LINE__ << ": "
86 return static_cast<float64>(rand() / (RAND_MAX + 1.0));
96 const float64 & low_pass_frequency_Hz,
97 const float64 & stereo_spread_seconds)
99 sample_rate_(sample_rate),
100 wet_percent_(wet_percent),
101 dry_percent_(dry_percent),
128 float64 lpf = low_pass_frequency_Hz;
135 float64 stereo_spread = stereo_spread_seconds;
137 if(stereo_spread < 0.0)
185 std::srand(static_cast<unsigned int>(std::time(0)));
192 sample_rate_(copy.sample_rate_),
193 wet_percent_(copy.wet_percent_),
194 dry_percent_(copy.dry_percent_),
246 for(
uint32 n = 0; n < n_samples; ++n)
248 filter(left, right, x[0][n], x[1][n]);
269 for(
uint32 n = 0; n < n_samples; ++n)
271 filter(left, right, x[n], x[n]);
FilterCombLowPassFeedback ** comb_left_
static const float64 ALL_PASS_DELAY_TIME_SECONDS_[N_ALL_PASS_FILTERS_]
FilterCombLowPassFeedback ** comb_right_
static const float64 ROOM_FEEDBACK_OFFSET_
uint32 getLength() const
Returns the number of samples of audio data in the stream.
AudioStream filter(const AudioStream &x)
ReverberationRoom(const float64 &sample_rate, const float64 &room_feedback, const float64 &wet_percent=0.5, const float64 &dry_percent=1.0, const float64 &low_pass_frequency_Hz=7644.9, const float64 &stereo_spread_seconds=0.0005215)
Default Constructor.
static const float64 ROOM_FEEDBACK_SCALE_
AudioStream filter(const AudioStream &x)
uint32 getLength() const
Returns the number of samples in the Buffer.
static const float64 COMB_DELAY_TIME_SECONDS_[N_COMB_FILTERS_]
uint32 getNChannels(void) const
Returns the number of audio channels in the stream.
virtual ~ReverberationRoom()
static const uint32 N_COMB_FILTERS_
A class for filtering audio in the frequecy domain.
A Buffer for storing audio samples.
AudioStream filter(const AudioStream &x)
ReverberationRoom & operator=(const ReverberationRoom &rhs)
FilterAllPass ** allpass_left_
static const uint32 N_ALL_PASS_FILTERS_
FilterAllPass ** allpass_right_