24 lines
656 B
C
24 lines
656 B
C
#ifndef AUDIO_H
|
|
#define AUDIO_H
|
|
#include <stdint.h>
|
|
|
|
#define MAX_RECORDING_SECONDS 2
|
|
|
|
typedef struct audio_state {
|
|
int recording_device_id;
|
|
int playback_device_id;
|
|
uint8_t* 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_device_pause(audio_state* state, int is_recording, int pause);
|
|
void audio_device_close(audio_state* state, int is_recording);
|
|
void audio_buffer_reset(audio_state* state);
|
|
|
|
#endif
|