7#ifndef __AUDIO_RTAUDIO_DEVICE_H__
8#define __AUDIO_RTAUDIO_DEVICE_H__
10#include "zrythm-config.h"
15#include "utils/ring_buffer.h"
19constexpr int RTAUDIO_DEVICE_BUFFER_SIZE = 32000;
23# include <rtaudio_c.h>
40 RTAUDIO_DEVICE_FLOW_OUTPUT,
41 RTAUDIO_DEVICE_FLOW_INPUT,
62 unsigned int device_id,
63 unsigned int channel_idx,
64 std::string device_name =
"");
81 void open (
bool start);
102 static void print_dev_info (
const rtaudio_device_info_t &nfo);
105 bool is_input_ =
false;
108 unsigned int channel_idx_ = 0;
111 unsigned int id_ = 0;
116 bool opened_ =
false;
119 bool started_ =
false;
121 rtaudio_t handle_ =
nullptr;
126 std::array<float, 0x4000> audio_buf_{};
129 RingBuffer<float> audio_ring_{ RTAUDIO_DEVICE_BUFFER_SIZE };
133 std::binary_semaphore audio_ring_sem_{ 1 };