#ifndef _AUDIO_H_ #define _AUDIO_H_ #include #include #include #include #define AUDIO_SAMPLE_FORMAT paFloat32 typedef float audio_sample_t; typedef struct audio_t { PaStream *stream; OpusEncoder *opus_enc; OpusDecoder *opus_dec; audio_sample_t *buffer; size_t buffer_size; } audio_t; int audio_init(audio_t *aud, int channels, int sample_rate, int frame_size); int audio_destroy(audio_t *aud); int audio_read(audio_t *aud, uint8_t *output, size_t output_len); int audio_write(audio_t *aud, const uint8_t *input, size_t input_len); #endif /* _AUDIO_H_ */