started making samplerate and buffer size configurable for audio device selection

This commit is contained in:
Dave Griffiths
2022-09-30 21:08:53 +01:00
parent a2b77951ca
commit fb8d607e2d
16 changed files with 112 additions and 124 deletions

View File

@@ -77,7 +77,7 @@ block::block(u64 id, const string &filename, const sample &pcm, u32 rate, const
m_orig_filename(filename),
m_usage(0)
{
init_fft(m_pcm.get_length());
init_fft(m_pcm.get_length(),rate);
assert(m_mfcc_proc!=NULL);
assert(m_fftw!=NULL);
@@ -97,12 +97,12 @@ block::block(u64 id, const string &filename, const sample &pcm, u32 rate, const
}
void block::init_fft(u32 block_size) {
void block::init_fft(u32 block_size, u32 rate) {
if (m_fftw == NULL || m_fftw->m_length!=block_size) {
if (m_fftw == NULL) delete m_fftw;
m_fftw = new FFT(block_size,100);
m_fftw = new FFT(block_size,rate,100);
if (m_mfcc_proc == NULL) delete m_mfcc_proc;
m_mfcc_proc = new Aquila::Mfcc(block_size);
m_mfcc_proc = new Aquila::Mfcc(block_size,rate);
}
}