15 #ifndef __IFLY_WINREC_H__ 16 #define __IFLY_WINREC_H__ 17 #include <alsa/asoundlib.h> 44 void (*
on_data_ind)(
char* data,
unsigned long len,
void* user_para);
71 int setRecordDuration(
const float duration_time);
91 float levelEnergy(
struct DataBuff pcm_data,
const int call_count);
92 float energyPerSample(
struct DataBuff pcm_data);
96 float background_energy_ = 0.0;
97 float temp_energy_ = 0.0;
98 float mean_energy_ = 0.0;
100 const float forgetfactor_ = 1;
101 const float adjustment_ = 0.05;
133 void (*
on_data_ind)(
char* data,
unsigned long len,
void* user_para),
int stopRecord(struct recorder *rec)
unsigned int record_rate_
struct recorder * record_
int openRecorder(struct recorder *rec, record_dev_id dev, WAVEFORMATEX *fmt, std::string base_path)
snd_pcm_uframes_t frames_
int createRecorder(struct recorder **out_rec, void(*on_data_ind)(char *data, unsigned long len, void *user_para), void *user_cb_para)
record_dev_id getDefaultInputDevice()
int startRecord(struct recorder *rec)
const std::string base_path
void destroyRecorder(struct recorder *rec)
void closeRecorder(struct recorder *rec)
snd_pcm_hw_params_t * params_
void(* on_data_ind)(char *data, unsigned long len, void *user_para)
std::string pcm_file_path
int isRecordStopped(struct recorder *rec)