SpectMorph
smmorphutils.hh
1 // Licensed GNU LGPL v2.1 or later: http://www.gnu.org/licenses/lgpl-2.1.html
2 
3 #ifndef SPECTMORPH_MORPH_UTILS_HH
4 #define SPECTMORPH_MORPH_UTILS_HH
5 
6 #include <algorithm>
7 #include <vector>
8 #include <stdint.h>
9 
10 #include "smaudio.hh"
11 #include "smlivedecoder.hh"
12 #include "smrtmemory.hh"
13 
14 namespace SpectMorph
15 {
16 
17 namespace MorphUtils
18 {
19 
20 struct FreqState
21 {
22  float freq_f;
23  int used;
24 };
25 
26 bool find_match (float freq, const FreqState *freq_state, size_t freq_state_size, size_t *index);
27 void init_freq_state (const std::vector<uint16_t>& fint, FreqState *freq_state);
28 void init_freq_state (const RTVector<uint16_t>& fint, FreqState *freq_state);
29 
30 AudioBlock* get_normalized_block_ptr (LiveDecoderSource *source, double time_ms);
31 bool get_normalized_block (LiveDecoderSource *source, double time_ms, RTAudioBlock& out_audio_block);
32 
33 }
34 
35 }
36 
37 #endif
Block of audio data, encoded in SpectMorph parametric format.
Definition: smaudio.hh:28
Definition: smlivedecodersource.hh:12
Definition: smrtmemory.hh:139
Definition: smmorphutils.hh:21