spLib
Loading...
Searching...
No Matches
spPicola.h
1/*
2 * spPicola.h
3 */
4
5#ifndef SPLIB_SPPICOLA_H
6#define SPLIB_SPPICOLA_H
7
8#include <sp/spDefs.h>
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#define SPPICOLA_VERSION_STRING "0.9.0"
15#define SPPICOLA_VERSION 0
16#define SPPICOLA_REVISION 9
17#define SPPICOLA_UPDATE_LEVEL 0
18#define SPPICOLA_VERSION_ID (SPPICOLA_VERSION * 1000 + SPPICOLA_REVISION)
19
20typedef struct _spPicola *spPicola;
21
22typedef struct _spPicolaConfig {
23 unsigned long version_id; /* this member is automatically initialized by spPicolaInitConfig */
24
25 double samp_freq; /* sampling frequency in Hz. default=8000Hz */
26 int num_channel; /* number of channels; stereo=2, mono=1. default=1 (mono) */
27
28 double max_input_buf_length_ms; /* maximum input buffer length per channel in msec. default=20msec */
29 double min_period_ms; /* minimum pitch period for internal processing */
30 double max_period_ms; /* maximum pitch period for internal processing */
31} spPicolaConfig;
32
33extern spBool _spPicolaInitConfig(spPicolaConfig *config, unsigned long version_id);
34extern spPicola spPicolaOpen(spPicolaConfig *config);
35extern spBool spPicolaSetRate(spPicola picola, double rate, long *max_input_buf_length, long *max_output_buf_length);
36extern spBool spPicolaProcess(spPicola picola,
37 double *input_buf, long *input_buf_length, double *output_buf, long *output_buf_length, long *input_delay);
38extern spBool spPicolaFlush(spPicola picola, double *output_buf, long *output_buf_length);
39extern spBool spPicolaClose(spPicola picola);
40
41#define spPicolaInitConfig(conf) _spPicolaInitConfig(conf, SPPICOLA_VERSION_ID)
42
43#ifdef __cplusplus
44} /* Close scope of 'extern "C"' declaration */
45#endif
46
47#endif /* SPLIB_SPPICOLA_H */
int spBool