spek

Acoustic spectrum analyser https://github.com/alexkay/spek spek.cc
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

spek-pipeline.h (1047B)


      1 #pragma once
      2 
      3 #include <memory>
      4 #include <string>
      5 
      6 class AudioFile;
      7 class FFTPlan;
      8 struct spek_pipeline;
      9 
     10 enum window_function {
     11     WINDOW_HANN,
     12     WINDOW_HAMMING,
     13     WINDOW_BLACKMAN_HARRIS,
     14     WINDOW_COUNT,
     15     WINDOW_DEFAULT = WINDOW_HANN,
     16 };
     17 
     18 typedef void (*spek_pipeline_cb)(int bands, int sample, float *values, void *cb_data);
     19 
     20 struct spek_pipeline * spek_pipeline_open(
     21     std::unique_ptr<AudioFile> file,
     22     std::unique_ptr<FFTPlan> fft,
     23     int stream,
     24     int channel,
     25     enum window_function window_function,
     26     int samples,
     27     spek_pipeline_cb cb,
     28     void *cb_data
     29 );
     30 
     31 void spek_pipeline_start(struct spek_pipeline *pipeline);
     32 void spek_pipeline_close(struct spek_pipeline *pipeline);
     33 
     34 std::string spek_pipeline_desc(const struct spek_pipeline *pipeline);
     35 int spek_pipeline_streams(const struct spek_pipeline *pipeline);
     36 int spek_pipeline_channels(const struct spek_pipeline *pipeline);
     37 double spek_pipeline_duration(const struct spek_pipeline *pipeline);
     38 int spek_pipeline_sample_rate(const struct spek_pipeline *pipeline);