22 lines
583 B
C
22 lines
583 B
C
#ifndef AUDIO_H
|
|
#define AUDIO_H
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
typedef struct audio_state {
|
|
int recording_device_id;
|
|
int playback_device_id;
|
|
Uint8* recording_buffer;
|
|
unsigned int recording_buffer_size;
|
|
unsigned int recording_buffer_position;
|
|
} audio_state;
|
|
|
|
int audio_init(audio_state* state);
|
|
void audio_destroy(audio_state* state);
|
|
int audio_recording_init(audio_state* state, int index);
|
|
int audio_playback_init(audio_state* state);
|
|
void audio_recording_callback(void* userdata, Uint8* stream, int len);
|
|
void audio_playback_callback(void* userdata, Uint8* stream, int len);
|
|
|
|
#endif
|