0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-26 19:23:51 +01:00
Files
fm95/io/audio.h

26 lines
916 B
C

#pragma once
#include <pulse/simple.h>
#include <pulse/error.h>
#include <string.h>
#include <stdlib.h>
typedef struct
{
pa_simple* dev;
pa_sample_spec sample_spec;
pa_buffer_attr buffer_attr;
char* app_name;
char* stream_name;
char* device;
int initialized;
} PulseInputDevice;
int init_PulseInputDevice(PulseInputDevice *dev, int sample_rate, int channels, char *app_name, char *stream_name, char *device, pa_buffer_attr *buffer_attr);
int read_PulseInputDevice(PulseInputDevice *dev, float *buffer, size_t size);
void free_PulseInputDevice(PulseInputDevice *dev);
typedef PulseInputDevice PulseOutputDevice;
int init_PulseOutputDevice(PulseOutputDevice *dev, int sample_rate, int channels, char *app_name, char *stream_name, char *device, pa_buffer_attr *buffer_attr);
int write_PulseOutputDevice(PulseOutputDevice *dev, float *buffer, size_t size);
void free_PulseOutputDevice(PulseOutputDevice *dev);