42 using namespace Nsound;
51 target_buffer_(&target),
52 window_size_(window_size),
62 target_buffer_(copy.target_buffer_),
63 window_size_(copy.window_size_),
64 position_(copy.position_)
142 y << (*target_buffer_)[next_pos];
146 if((*target_buffer_)[next_pos] > 0.0)
151 else if((*target_buffer_)[next_pos] < 0.0)
188 if((*target_buffer_)[next_pos] > 0.0)
193 else if((*target_buffer_)[next_pos] < 0.0)
205 if( std::fabs((*target_buffer_)[next_pos-1]) <
206 std::fabs((*target_buffer_)[next_pos]))
Buffer subbuffer(uint32 start_index, uint32 n_samples=0) const
Slice the Buffer.
#define M_ASSERT_VALUE(a, op, value)
const Buffer * target_buffer_
uint32 getLength() const
Returns the number of samples in the Buffer.
Buffer getNextWindow()
Searches the target Buffer for a zero crossing at or after the window_size position.
BufferWindowSearch & operator=(const BufferWindowSearch &rhs)
BufferWindowSearch(const Buffer &buffer, uint32 window_size=2048)
A Buffer for storing audio samples.
Searches the target Buffer for zero crossings at or after the window_size position.
uint32 getSamplesLeft() const
Returns how many samples are left in the target Buffer.