comparison trunk/src/Modules/SAI/ModuleSAI.cc @ 278:5b8b9ea1218a

- Added a basic main function to test that all the can be fitted together - Fixed an initialisation bug in ModuleFileInput that left the buffer size at zero - Added proper description strings to the input and output modules - Fixed an out-by-a-factor-of-1000 bug in the SAI memory allocation (oops) - Added LOG_INFO_NN fucnction to log without a newline. Useful for the ASCII art module chain in aimc.cc.
author tomwalters
date Thu, 18 Feb 2010 19:35:07 +0000
parents 6b4921704eb1
children e55d0c225a57
comparison
equal deleted inserted replaced
277:6b4921704eb1 278:5b8b9ea1218a
55 55
56 bool ModuleSAI::InitializeInternal(const SignalBank &input) { 56 bool ModuleSAI::InitializeInternal(const SignalBank &input) {
57 // The SAI output bank must be as long as the SAI's Maximum delay. 57 // The SAI output bank must be as long as the SAI's Maximum delay.
58 // One sample is added to the SAI buffer length to account for the 58 // One sample is added to the SAI buffer length to account for the
59 // zero-lag point 59 // zero-lag point
60 int sai_buffer_length = 1 + floor(input.sample_rate() * max_delay_ms_); 60 int sai_buffer_length = 1 + floor(input.sample_rate() * max_delay_ms_
61 / 1000.0f);
61 channel_count_ = input.channel_count(); 62 channel_count_ = input.channel_count();
62 63
63 // Make an output SignalBank with the same number of channels and centre 64 // Make an output SignalBank with the same number of channels and centre
64 // frequencies as the input, but with a different buffer length 65 // frequencies as the input, but with a different buffer length
65 if (!output_.Initialize(input.channel_count(), 66 if (!output_.Initialize(input.channel_count(),