From c1bdfe8c9fbe4e514e83dc2be773b5623ee573b3 Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Sat, 21 Oct 2023 23:53:18 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20doxygen=20from=20@=20pschatzma?= =?UTF-8?q?nn/arduino-audio-tools@8089a7bb2c2d9d0b1861cb215b2c5f42ca75333a?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _communication_8h_source.html | 61 +-- _v_b_a_n_stream_8h_source.html | 447 +++++++++--------- classaudio__tools_1_1_throttle-members.html | 3 +- classaudio__tools_1_1_throttle.html | 3 + ...dio__tools_1_1_v_b_a_n_config-members.html | 2 +- classaudio__tools_1_1_v_b_a_n_config.html | 6 +- ...io__tools_1_1_throttle_config-members.html | 2 +- structaudio__tools_1_1_throttle_config.html | 6 +- 8 files changed, 269 insertions(+), 261 deletions(-) diff --git a/_communication_8h_source.html b/_communication_8h_source.html index 31fc290937..27bb8ce43c 100644 --- a/_communication_8h_source.html +++ b/_communication_8h_source.html @@ -719,7 +719,7 @@
740  bits_per_sample = 16;
741  channels = 2;
742  }
-
743  int correction_ms = 0;
+
743  int correction_us = 0;
744 };
745 
752 class Throttle {
@@ -740,32 +740,38 @@
767  void begin(ThrottleConfig info) {
768  this->info = info;
769  bytesPerSample = info.bits_per_sample / 8 * info.channels;
-
770  }
-
771 
-
772  // starts the timing
-
773  void startDelay() { start_time = millis(); }
-
774 
-
775  // delay
-
776  void delayBytes(size_t bytes) { delaySamples(bytes / bytesPerSample); }
-
777 
-
778  // delay
-
779  void delaySamples(size_t samples) {
-
780  int durationMsEff = millis() - start_time;
-
781  int durationToBe = (samples * 1000) / info.sample_rate;
-
782  int waitMs = durationToBe - durationMsEff + info.correction_ms;
-
783  LOGI("wait: %d", waitMs);
-
784  if (waitMs > 0) {
-
785  delay(waitMs);
-
786  }
-
787  }
-
788 
-
789  protected:
-
790  unsigned long start_time;
-
791  ThrottleConfig info;
-
792  int bytesPerSample;
-
793 };
-
794 
-
795 } // namespace audio_tools
+
770  startDelay();
+
771  }
+
772 
+
773  // starts the timing
+
774  void startDelay() {
+
775  start_time = micros();
+
776  sum_samples = 0;
+
777  }
+
778 
+
779  // delay
+
780  void delayBytes(size_t bytes) { delaySamples(bytes / bytesPerSample); }
+
781 
+
782  // delay
+
783  void delaySamples(size_t samples) {
+
784  sum_samples += samples;
+
785  int64_t durationUsEff = micros() - start_time;
+
786  int64_t durationUsToBe = (sum_samples * 1000000) / info.sample_rate;
+
787  int64_t waitUs = durationUsToBe - durationUsEff + info.correction_us;
+
788  LOGI("wait: %d", waitUs);
+
789  if (waitUs > 0) {
+
790  delayMicroseconds(waitUs);
+
791  }
+
792  }
+
793 
+
794  protected:
+
795  unsigned long start_time;
+
796  uint64_t sum_samples = 0;
+
797  ThrottleConfig info;
+
798  int bytesPerSample;
+
799 };
+
800 
+
801 } // namespace audio_tools
Abstract Audio Ouptut class.
Definition: AudioOutput.h:22
Base class for all Audio Streams. It support the boolean operator to test if the object is ready with...
Definition: AudioStreams.h:47
Receving Audio Data over the wire and requesting for more data when done to synchronize the processin...
Definition: Communication.h:630
@@ -811,7 +817,6 @@
uint8_t begin(uint16_t port, uint16_t port_ext=0)
Starts to receive data from/with the indicated port.
Definition: Communication.h:443
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition: AnalogAudio.h:10
void delay(uint64_t ms)
Waits for the indicated milliseconds.
Definition: Millis.h:10
-
uint64_t millis()
Returns the milliseconds since the start.
Definition: Millis.h:17
Protocol Record for Request.
Definition: Communication.h:544
Protocal Record To Start.
Definition: Communication.h:529
Protocol Record for End.
Definition: Communication.h:550
diff --git a/_v_b_a_n_stream_8h_source.html b/_v_b_a_n_stream_8h_source.html index 966f13fca9..8bfe653bb8 100644 --- a/_v_b_a_n_stream_8h_source.html +++ b/_v_b_a_n_stream_8h_source.html @@ -95,7 +95,7 @@
29  // set to true if samples are generated faster then sample rate
30  bool throttle_active = false;
31  // when negative the number of ms that are subtracted from the calculated wait time to fine tune Overload and Underruns
-
32  int throttle_correction_ms = -2;
+
32  int throttle_correction_us = 0;
33  // defines the max write size
34  int max_write_size = DEFAULT_BUFFER_SIZE * 2; // just good enough for 44100 stereo
35 };
@@ -113,7 +113,7 @@
57  AudioStream::setAudioInfo(info);
58  auto thc = throttle.defaultConfig();
59  thc.copyFrom(info);
-
60  thc.correction_ms = cfg.throttle_correction_ms;;
+
60  thc.correction_us = cfg.throttle_correction_us;;
61  throttle.begin(thc);
62  if (cfg.mode==TX_MODE){
63  configure_tx();
@@ -167,230 +167,229 @@
111  tx_buffer.reset();
112  }
113  }
-
114  throttle.startDelay();
-
115  return byteCount;
-
116  }
-
117 
-
118  int availableForWrite() {
-
119  return cfg.max_write_size;
-
120  }
-
121 
-
122  size_t readBytes(uint8_t* data, size_t byteCount) override {
-
123  return rx_buffer.readArray(data, byteCount);
-
124  }
-
125 
-
126  int available() {
-
127  return rx_buffer.available();
-
128  }
-
129 
-
130  protected:
-
131  const IPAddress broadcast_address{0,0,0,0};
-
132  AsyncUDP udp;
-
133  VBan vban;
-
134  VBANConfig cfg;
-
135  SingleBuffer<int16_t> tx_buffer{0};
-
136  NBuffer<uint8_t> rx_buffer{VBAN_PACKET_MAX_LEN_BYTES, 0};
-
137  bool udp_connected = false;
-
138  uint32_t packet_counter = 0;
-
139  Throttle throttle;
+
114  return byteCount;
+
115  }
+
116 
+
117  int availableForWrite() {
+
118  return cfg.max_write_size;
+
119  }
+
120 
+
121  size_t readBytes(uint8_t* data, size_t byteCount) override {
+
122  return rx_buffer.readArray(data, byteCount);
+
123  }
+
124 
+
125  int available() {
+
126  return rx_buffer.available();
+
127  }
+
128 
+
129  protected:
+
130  const IPAddress broadcast_address{0,0,0,0};
+
131  AsyncUDP udp;
+
132  VBan vban;
+
133  VBANConfig cfg;
+
134  SingleBuffer<int16_t> tx_buffer{0};
+
135  NBuffer<uint8_t> rx_buffer{VBAN_PACKET_MAX_LEN_BYTES, 0};
+
136  bool udp_connected = false;
+
137  uint32_t packet_counter = 0;
+
138  Throttle throttle;
+
139 
140 
-
141 
-
142  bool begin_tx(){
-
143  if (!configure_tx()){
-
144  return false;
-
145  }
-
146  start_wifi();
-
147  if (WiFi.status() != WL_CONNECTED){
-
148  LOGE("Wifi not connected");
-
149  return false;
-
150  }
-
151  WiFi.setSleep(false);
-
152  IPAddress myIP = WiFi.localIP();
-
153  udp_connected = udp.connect(myIP, cfg.udp_port);
-
154  return udp_connected;
-
155  }
-
156 
-
157  bool begin_rx(){
-
158  start_wifi();
-
159  if (WiFi.status() != WL_CONNECTED){
-
160  LOGE("Wifi not connected");
-
161  return false;
-
162  }
-
163  WiFi.setSleep(false);
-
164  udp.onPacket([this](AsyncUDPPacket packet) {
-
165  receive_udp(packet);
-
166  });
-
167 
-
168  return true;
-
169  }
-
170 
-
171  bool configure_tx(){
-
172  int rate = vban_sample_rate();
-
173  if (rate<0){
-
174  LOGE("Invalid sample rate: %d", cfg.sample_rate);
-
175  return false;
-
176  }
-
177  configure_vban((VBanSampleRates)rate);
-
178  return true;
-
179  }
-
180 
-
181  void start_wifi(){
-
182  if(cfg.ssid==nullptr) return;
-
183  if(cfg.password==nullptr) return;
-
184  LOGI("ssid %s", cfg.ssid);
-
185  // Setup Wifi:
-
186  WiFi.begin(cfg.ssid, cfg.password); //Connect to your WiFi router
-
187  while (WiFi.status() != WL_CONNECTED) { // Wait for connection
-
188  delay(500);
-
189  Serial.print(".");
-
190  }
-
191  Serial.println();
-
192 
-
193  LOGI("Wifi connected to IP (%d.%d.%d.%d)",WiFi.localIP()[0],WiFi.localIP()[1],WiFi.localIP()[2],WiFi.localIP()[3]);
-
194  }
+
141  bool begin_tx(){
+
142  if (!configure_tx()){
+
143  return false;
+
144  }
+
145  start_wifi();
+
146  if (WiFi.status() != WL_CONNECTED){
+
147  LOGE("Wifi not connected");
+
148  return false;
+
149  }
+
150  WiFi.setSleep(false);
+
151  IPAddress myIP = WiFi.localIP();
+
152  udp_connected = udp.connect(myIP, cfg.udp_port);
+
153  return udp_connected;
+
154  }
+
155 
+
156  bool begin_rx(){
+
157  start_wifi();
+
158  if (WiFi.status() != WL_CONNECTED){
+
159  LOGE("Wifi not connected");
+
160  return false;
+
161  }
+
162  WiFi.setSleep(false);
+
163  udp.onPacket([this](AsyncUDPPacket packet) {
+
164  receive_udp(packet);
+
165  });
+
166 
+
167  return true;
+
168  }
+
169 
+
170  bool configure_tx(){
+
171  int rate = vban_sample_rate();
+
172  if (rate<0){
+
173  LOGE("Invalid sample rate: %d", cfg.sample_rate);
+
174  return false;
+
175  }
+
176  configure_vban((VBanSampleRates)rate);
+
177  return true;
+
178  }
+
179 
+
180  void start_wifi(){
+
181  if(cfg.ssid==nullptr) return;
+
182  if(cfg.password==nullptr) return;
+
183  LOGI("ssid %s", cfg.ssid);
+
184  // Setup Wifi:
+
185  WiFi.begin(cfg.ssid, cfg.password); //Connect to your WiFi router
+
186  while (WiFi.status() != WL_CONNECTED) { // Wait for connection
+
187  delay(500);
+
188  Serial.print(".");
+
189  }
+
190  Serial.println();
+
191 
+
192  LOGI("Wifi connected to IP (%d.%d.%d.%d)",WiFi.localIP()[0],WiFi.localIP()[1],WiFi.localIP()[2],WiFi.localIP()[3]);
+
193  }
+
194 
195 
-
196 
-
197  void configure_vban(VBanSampleRates rate) {
-
198  // Set vban packet header, counter, and data frame pointers to respective parts of packet:
-
199  vban.hdr = (VBanHeader*) &vban.packet[0];
-
200  vban.packet_counter = (uint32_t*) &vban.packet[VBAN_PACKET_HEADER_BYTES];
-
201  vban.data_frame = (uint8_t*) &vban.packet[VBAN_PACKET_HEADER_BYTES + VBAN_PACKET_COUNTER_BYTES];
-
202 
-
203  // Setup the packet header:
-
204  strncpy(vban.hdr->preamble, "VBAN", 4);
-
205  vban.hdr->sample_rate = VBAN_PROTOCOL_AUDIO | rate; // 11025 Hz, which matches default sample rate for soundmodem
-
206  vban.hdr->num_samples = (VBAN_PACKET_NUM_SAMPLES / cfg.channels)-1; // 255 = 256 samples
-
207  vban.hdr->num_channels = cfg.channels - 1; // 0 = 1 channel
-
208  vban.hdr->sample_format = VBAN_BITFMT_16_INT | VBAN_CODEC_PCM; // int16 PCM
-
209  strncpy(vban.hdr->stream_name, cfg.stream_name, min((int)strlen(cfg.stream_name),VBAN_STREAM_NAME_SIZE));
-
210 
-
211  vban.packet_data_bytes = (vban.hdr->num_samples+1) * (vban.hdr->num_channels+1) * ((vban.hdr->sample_format & VBAN_BIT_RESOLUTION_MASK)+1);
-
212  vban.packet_total_bytes = vban.packet_data_bytes + VBAN_PACKET_HEADER_BYTES + VBAN_PACKET_COUNTER_BYTES;
-
213  }
+
196  void configure_vban(VBanSampleRates rate) {
+
197  // Set vban packet header, counter, and data frame pointers to respective parts of packet:
+
198  vban.hdr = (VBanHeader*) &vban.packet[0];
+
199  vban.packet_counter = (uint32_t*) &vban.packet[VBAN_PACKET_HEADER_BYTES];
+
200  vban.data_frame = (uint8_t*) &vban.packet[VBAN_PACKET_HEADER_BYTES + VBAN_PACKET_COUNTER_BYTES];
+
201 
+
202  // Setup the packet header:
+
203  strncpy(vban.hdr->preamble, "VBAN", 4);
+
204  vban.hdr->sample_rate = VBAN_PROTOCOL_AUDIO | rate; // 11025 Hz, which matches default sample rate for soundmodem
+
205  vban.hdr->num_samples = (VBAN_PACKET_NUM_SAMPLES / cfg.channels)-1; // 255 = 256 samples
+
206  vban.hdr->num_channels = cfg.channels - 1; // 0 = 1 channel
+
207  vban.hdr->sample_format = VBAN_BITFMT_16_INT | VBAN_CODEC_PCM; // int16 PCM
+
208  strncpy(vban.hdr->stream_name, cfg.stream_name, min((int)strlen(cfg.stream_name),VBAN_STREAM_NAME_SIZE));
+
209 
+
210  vban.packet_data_bytes = (vban.hdr->num_samples+1) * (vban.hdr->num_channels+1) * ((vban.hdr->sample_format & VBAN_BIT_RESOLUTION_MASK)+1);
+
211  vban.packet_total_bytes = vban.packet_data_bytes + VBAN_PACKET_HEADER_BYTES + VBAN_PACKET_COUNTER_BYTES;
+
212  }
+
213 
214 
-
215 
-
216  int vban_sample_rate(){
-
217  int result = -1;
-
218  switch(cfg.sample_rate){
-
219  case 6000:
-
220  result = SAMPLE_RATE_6000_HZ;
-
221  break;
-
222  case 12000:
-
223  result = SAMPLE_RATE_12000_HZ;
-
224  break;
-
225  case 24000:
-
226  result = SAMPLE_RATE_24000_HZ;
-
227  break;
-
228  case 48000:
-
229  result = SAMPLE_RATE_48000_HZ;
-
230  break;
-
231  case 96000:
-
232  result = SAMPLE_RATE_96000_HZ;
-
233  break;
-
234  case 192000:
-
235  result = SAMPLE_RATE_192000_HZ;
-
236  break;
-
237  case 384000:
-
238  result = SAMPLE_RATE_384000_HZ;
-
239  break;
-
240  case 8000:
-
241  result = SAMPLE_RATE_8000_HZ;
-
242  break;
-
243  case 16000:
-
244  result = SAMPLE_RATE_16000_HZ;
-
245  break;
-
246  case 32000:
-
247  result = SAMPLE_RATE_32000_HZ;
-
248  break;
-
249  case 64000:
-
250  result = SAMPLE_RATE_64000_HZ;
-
251  break;
-
252  case 128000:
-
253  result = SAMPLE_RATE_128000_HZ;
-
254  break;
-
255  case 256000:
-
256  result = SAMPLE_RATE_256000_HZ;
-
257  break;
-
258  case 512000:
-
259  result = SAMPLE_RATE_512000_HZ;
-
260  break;
-
261  case 11025:
-
262  result = SAMPLE_RATE_11025_HZ;
-
263  break;
-
264  case 22050:
-
265  result = SAMPLE_RATE_22050_HZ;
-
266  break;
-
267  case 44100:
-
268  result = SAMPLE_RATE_44100_HZ;
-
269  break;
-
270  case 88200:
-
271  result = SAMPLE_RATE_88200_HZ;
-
272  break;
-
273  case 176400:
-
274  result = SAMPLE_RATE_176400_HZ;
-
275  break;
-
276  case 352800:
-
277  result = SAMPLE_RATE_352800_HZ;
-
278  break;
-
279  case 705600:
-
280  result = SAMPLE_RATE_705600_HZ;
-
281  break;
-
282  }
-
283  return result;
-
284  }
-
285 
-
301  void receive_udp(AsyncUDPPacket &packet){
-
302  uint16_t vban_rx_data_bytes, vban_rx_sample_count;
-
303  int16_t* vban_rx_data;
-
304  uint32_t* vban_rx_pkt_nbr;
-
305  uint16_t outBuf[VBAN_PACKET_MAX_SAMPLES+1];
-
306  size_t bytesOut;
-
307 
-
308  int len = packet.length();
-
309  if (len>0) {
-
310  uint8_t* udpIncomingPacket = packet.data();
-
311 
-
312  // receive incoming UDP packet
-
313  // Check if packet length meets VBAN specification:
-
314  if (len<=(VBAN_PACKET_HEADER_BYTES+VBAN_PACKET_COUNTER_BYTES) || len>VBAN_PACKET_MAX_LEN_BYTES) {
-
315  LOGE("Error: packet length %u bytes\n", len);
-
316  return;
-
317  }
-
318 
-
319  // Check if preamble matches VBAN format:
-
320  if(strncmp("VBAN",(const char*)udpIncomingPacket,4)!=0){
-
321  LOGE("Unrecognized preamble %.4s\n", udpIncomingPacket);
-
322  return;
-
323  }
-
324 
-
325  vban_rx_data_bytes = len - (VBAN_PACKET_HEADER_BYTES+VBAN_PACKET_COUNTER_BYTES);
-
326  vban_rx_pkt_nbr = (uint32_t*)&udpIncomingPacket[VBAN_PACKET_HEADER_BYTES];
-
327  vban_rx_data = (int16_t*)&udpIncomingPacket[VBAN_PACKET_HEADER_BYTES+VBAN_PACKET_COUNTER_BYTES];
-
328  vban_rx_sample_count = vban_rx_data_bytes/2;
-
329  uint8_t vbanSampleRateIdx = udpIncomingPacket[4] & VBAN_SR_MASK;
-
330  uint8_t vbchannels = udpIncomingPacket[6]+1;
-
331  uint32_t vbanSampleRate = VBanSRList[vbanSampleRateIdx];
-
332 
-
333  // Just to be safe, re-check sample count against max sample count to avoid overrunning outBuf later
-
334  if(vban_rx_sample_count > VBAN_PACKET_MAX_SAMPLES){
-
335  LOGE("error: unexpected packet size: %u\n",vban_rx_sample_count);
-
336  return;
-
337  }
-
338 
-
339  // update sample rate
-
340  if (cfg.sample_rate != vbanSampleRate || cfg.channels != vbchannels){
-
341  cfg.sample_rate = vbanSampleRate;
-
342  cfg.channels = vbchannels;
-
343  setAudioInfo(cfg);
-
344  }
-
345 
-
346  // write data to buffer
-
347  rx_buffer.writeArray((uint8_t*)&vban_rx_data, vban_rx_sample_count*sizeof(uint16_t));
-
348  }
-
349  }
-
350 };
-
351 
-
352 }
+
215  int vban_sample_rate(){
+
216  int result = -1;
+
217  switch(cfg.sample_rate){
+
218  case 6000:
+
219  result = SAMPLE_RATE_6000_HZ;
+
220  break;
+
221  case 12000:
+
222  result = SAMPLE_RATE_12000_HZ;
+
223  break;
+
224  case 24000:
+
225  result = SAMPLE_RATE_24000_HZ;
+
226  break;
+
227  case 48000:
+
228  result = SAMPLE_RATE_48000_HZ;
+
229  break;
+
230  case 96000:
+
231  result = SAMPLE_RATE_96000_HZ;
+
232  break;
+
233  case 192000:
+
234  result = SAMPLE_RATE_192000_HZ;
+
235  break;
+
236  case 384000:
+
237  result = SAMPLE_RATE_384000_HZ;
+
238  break;
+
239  case 8000:
+
240  result = SAMPLE_RATE_8000_HZ;
+
241  break;
+
242  case 16000:
+
243  result = SAMPLE_RATE_16000_HZ;
+
244  break;
+
245  case 32000:
+
246  result = SAMPLE_RATE_32000_HZ;
+
247  break;
+
248  case 64000:
+
249  result = SAMPLE_RATE_64000_HZ;
+
250  break;
+
251  case 128000:
+
252  result = SAMPLE_RATE_128000_HZ;
+
253  break;
+
254  case 256000:
+
255  result = SAMPLE_RATE_256000_HZ;
+
256  break;
+
257  case 512000:
+
258  result = SAMPLE_RATE_512000_HZ;
+
259  break;
+
260  case 11025:
+
261  result = SAMPLE_RATE_11025_HZ;
+
262  break;
+
263  case 22050:
+
264  result = SAMPLE_RATE_22050_HZ;
+
265  break;
+
266  case 44100:
+
267  result = SAMPLE_RATE_44100_HZ;
+
268  break;
+
269  case 88200:
+
270  result = SAMPLE_RATE_88200_HZ;
+
271  break;
+
272  case 176400:
+
273  result = SAMPLE_RATE_176400_HZ;
+
274  break;
+
275  case 352800:
+
276  result = SAMPLE_RATE_352800_HZ;
+
277  break;
+
278  case 705600:
+
279  result = SAMPLE_RATE_705600_HZ;
+
280  break;
+
281  }
+
282  return result;
+
283  }
+
284 
+
300  void receive_udp(AsyncUDPPacket &packet){
+
301  uint16_t vban_rx_data_bytes, vban_rx_sample_count;
+
302  int16_t* vban_rx_data;
+
303  uint32_t* vban_rx_pkt_nbr;
+
304  uint16_t outBuf[VBAN_PACKET_MAX_SAMPLES+1];
+
305  size_t bytesOut;
+
306 
+
307  int len = packet.length();
+
308  if (len>0) {
+
309  uint8_t* udpIncomingPacket = packet.data();
+
310 
+
311  // receive incoming UDP packet
+
312  // Check if packet length meets VBAN specification:
+
313  if (len<=(VBAN_PACKET_HEADER_BYTES+VBAN_PACKET_COUNTER_BYTES) || len>VBAN_PACKET_MAX_LEN_BYTES) {
+
314  LOGE("Error: packet length %u bytes\n", len);
+
315  return;
+
316  }
+
317 
+
318  // Check if preamble matches VBAN format:
+
319  if(strncmp("VBAN",(const char*)udpIncomingPacket,4)!=0){
+
320  LOGE("Unrecognized preamble %.4s\n", udpIncomingPacket);
+
321  return;
+
322  }
+
323 
+
324  vban_rx_data_bytes = len - (VBAN_PACKET_HEADER_BYTES+VBAN_PACKET_COUNTER_BYTES);
+
325  vban_rx_pkt_nbr = (uint32_t*)&udpIncomingPacket[VBAN_PACKET_HEADER_BYTES];
+
326  vban_rx_data = (int16_t*)&udpIncomingPacket[VBAN_PACKET_HEADER_BYTES+VBAN_PACKET_COUNTER_BYTES];
+
327  vban_rx_sample_count = vban_rx_data_bytes/2;
+
328  uint8_t vbanSampleRateIdx = udpIncomingPacket[4] & VBAN_SR_MASK;
+
329  uint8_t vbchannels = udpIncomingPacket[6]+1;
+
330  uint32_t vbanSampleRate = VBanSRList[vbanSampleRateIdx];
+
331 
+
332  // Just to be safe, re-check sample count against max sample count to avoid overrunning outBuf later
+
333  if(vban_rx_sample_count > VBAN_PACKET_MAX_SAMPLES){
+
334  LOGE("error: unexpected packet size: %u\n",vban_rx_sample_count);
+
335  return;
+
336  }
+
337 
+
338  // update sample rate
+
339  if (cfg.sample_rate != vbanSampleRate || cfg.channels != vbchannels){
+
340  cfg.sample_rate = vbanSampleRate;
+
341  cfg.channels = vbchannels;
+
342  setAudioInfo(cfg);
+
343  }
+
344 
+
345  // write data to buffer
+
346  rx_buffer.writeArray((uint8_t*)&vban_rx_data, vban_rx_sample_count*sizeof(uint16_t));
+
347  }
+
348  }
+
349 };
+
350 
+
351 }
Base class for all Audio Streams. It support the boolean operator to test if the object is ready with...
Definition: AudioStreams.h:47
virtual int readArray(T data[], int len)
reads multiple values
Definition: Buffers.h:40
virtual int writeArray(const T data[], int len)
Fills the buffer data.
Definition: Buffers.h:60
@@ -409,7 +408,7 @@
const char * password
password for wifi connection
Definition: VBANStream.h:27
const char * stream_name
name of the stream
Definition: VBANStream.h:19
VBAN Audio Source and Sink for the ESP32. For further details please see https://vb-audio....
Definition: VBANStream.h:47
-
void receive_udp(AsyncUDPPacket &packet)
VBAN adjusts the number of samples per packet according to sample rate. Assuming 16-bit PCM mono,...
Definition: VBANStream.h:301
+
void receive_udp(AsyncUDPPacket &packet)
VBAN adjusts the number of samples per packet according to sample rate. Assuming 16-bit PCM mono,...
Definition: VBANStream.h:300
RxTxMode
Audio Source (TX_MODE) or Audio Sink (RX_MODE). RXTX_MODE is Source and Sink at the same time!
Definition: AudioTypes.h:24
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition: AnalogAudio.h:10
void delay(uint64_t ms)
Waits for the indicated milliseconds.
Definition: Millis.h:10
diff --git a/classaudio__tools_1_1_throttle-members.html b/classaudio__tools_1_1_throttle-members.html index bce0f9d8f8..ce5fe28b2f 100644 --- a/classaudio__tools_1_1_throttle-members.html +++ b/classaudio__tools_1_1_throttle-members.html @@ -81,7 +81,8 @@ info (defined in Throttle)Throttleprotected start_time (defined in Throttle)Throttleprotected startDelay() (defined in Throttle)Throttleinline - Throttle()=default (defined in Throttle)Throttle + sum_samples (defined in Throttle)Throttleprotected + Throttle()=default (defined in Throttle)Throttle