-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsiowrap.h
More file actions
33 lines (25 loc) · 870 Bytes
/
Copy pathsiowrap.h
File metadata and controls
33 lines (25 loc) · 870 Bytes
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
#ifndef _SIOWRAP_H_
#define _SIOWRAP_H_ 1
#include<soundio/soundio.h>
#include<stdio.h>
typedef struct siowrap_struct siowrap_t, *siowrap_p;
typedef size_t (*on_write_sample)(siowrap_p s, int sample_rate, int channel_count, void **pointers_per_channel, size_t *sample_pointer_steps, size_t samples_to_write_per_channel);
struct siowrap_struct
{
void *userdata;
FILE *log_fp;
int default_out_device_index;
enum SoundIoFormat format;
int sample_rate;
on_write_sample write_cb;
int channel_count;
void **pointers_of_channels;
size_t *sample_pointer_steps; // in bytes
struct SoundIo *soundio;
struct SoundIoDevice *device;
struct SoundIoOutStream *outstream;
};
siowrap_p siowrap_create(FILE *log_fp, enum SoundIoFormat format, int sample_rate, on_write_sample write_cb);
void siowrap_wait_events(siowrap_p s);
void siowrap_destroy(siowrap_p s);
#endif