1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/**********************************************************************
nyx.h
Nyx: A very simple external interface to Nyquist
Dominic Mazzoni
**********************************************************************/
#ifndef __NYX__
#define __NYX__
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
typedef enum {
nyx_error,
nyx_audio,
nyx_int,
nyx_double,
nyx_string,
nyx_labels
} nyx_rval;
void nyx_init();
void nyx_cleanup();
/* should return return 0 for success, -1 for error */
typedef int (*nyx_audio_callback)(float *buffer,
int channel,
long start, long len,
void *userdata);
void nyx_set_input_audio(nyx_audio_callback callback,
void *userdata,
int num_channels,
long len, double rate);
nyx_rval nyx_eval_expression(const char *expr);
int nyx_get_audio_num_channels();
void nyx_get_audio(nyx_audio_callback callback,
void *userdata);
int nyx_get_int();
double nyx_get_double();
const char *nyx_get_string();
int nyx_get_num_labels();
void nyx_get_label(int index,
double *time,
const char **label);
const char *nyx_get_error_str();
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __NYX__ */
|