7 FB2K_DYNAMIC_ASSERT( sampleRate > 0 );
14 if (fftSize >= inSize) {
18 const double baseOffset = pfc::max_t<double>(0, centerOffset - 0.5 * (double)fftSize / (
double)sampleRate);
19 const t_size baseSample = pfc::min_t<t_size>( (
t_size) audio_math::time_to_samples(baseOffset, sampleRate), inSize - fftSize);
25 return p_size >= 2 && (p_size & (p_size - 1)) == 0;
29 if (samples <= 2)
return 2;
32 samples &= ~mask; mask <<= 1;
unsigned get_sample_rate() const
Helper, same as get_srate().
Interface to container of a chunk of audio data. See audio_chunk_impl for an implementation.
virtual unsigned get_channel_config() const =0
Retrieves channel map of contained audio data. Conditions where number of channels specified by chann...
void PrepareFFTChunk(audio_chunk const &source, audio_chunk &out, double centerOffset)
Turns an arbitrary audio_chunk into a valid chunk to run FFT on, with proper sample count etc...
virtual audio_sample * get_data()=0
Retrieves audio data buffer pointer (non-const version). Returned pointer is for temporary use only; ...
void memset_null_t(T *p_buffer, t_size p_count)
t_size MatchFFTSize(t_size samples)
bool IsValidFFTSize(t_size p_size)
virtual void set_channels(unsigned p_count, unsigned p_config)=0
Sets channel count / channel map.
virtual void set_data_size(t_size p_new_size)=0
Resizes audio data buffer to specified size. Throws std::bad_alloc on failure.
void memcpy_t(t_dst *p_dst, const t_src *p_src, t_size p_count)
unsigned get_channel_count() const
Helper - for consistency - same as get_channels().
virtual t_size get_sample_count() const =0
Retrieves number of valid samples in the buffer. Note that a "sample" means a unit of interleaved PC...
virtual void set_sample_count(t_size val)=0
Sets number of valid samples in the buffer. WARNING: sample count * channel count should never be abo...
void set_sample_rate(unsigned val)
Helper, same as set_srate().