1
0
tetatet/src/audio.h

25 lines
646 B
C
Raw Normal View History

2024-03-21 04:10:02 +04:00
#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_ */