25 lines
646 B
C
25 lines
646 B
C
|
#ifndef _AUDIO_H_
|
||
|
#define _AUDIO_H_
|
||
|
|
||
|
#include <stdint.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
#include <opus/opus.h>
|
||
|
#include <portaudio.h>
|
||
|
|
||
|
typedef struct audio_t {
|
||
|
PaStream *stream;
|
||
|
OpusEncoder *opusEnc;
|
||
|
OpusDecoder *opusDec;
|
||
|
uint8_t *opusBuf;
|
||
|
size_t opusBufSz;
|
||
|
} audio_t;
|
||
|
|
||
|
int audio_default_callback(const void *input, void *output,
|
||
|
unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo,
|
||
|
PaStreamCallbackFlags statusFlags, void *userData);
|
||
|
|
||
|
int audio_init_default(audio_t *aud, int channels, int sampleRate, int frameSize, PaStreamCallback *callback);
|
||
|
int audio_destroy(audio_t *aud);
|
||
|
|
||
|
#endif /* _AUDIO_H_ */
|