-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.c
38 lines (31 loc) · 1001 Bytes
/
example.c
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
/*******************************************************************************
Capturing data from the soundcard and visualize its bands
*******************************************************************************/
#include "audiocapture.h"
#include <stdio.h>
#include "artnet_send.h"
/* here one packages arrives and could be modified */
void handleIncomeingSample(const double* array, const int length)
{
int i;
printf("The compressed size is %d\n", length);
for(i=0; i < length; i++) {
printf("%lf\n", array[i]);
}
}
int main(int argc, char *argv[]) {
AUDIO_CAPTURE_RET ret = audiocapture_init(&handleIncomeingSample);
if (AUDIO_CAPTURE_RET_OK != ret)
{
printf("There was an error while initing the capturing device\n");
return 1;
}
/* should start the endless loop that recordes the audio data */
ret = audiocapture_start();
if (AUDIO_CAPTURE_RET_OK != ret)
{
printf("There was an error while initing the capturing device\n");
return 1;
}
return 0;
}