You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checks if the I2S is readable, writable or both (in full-duplex mode).
343
343
@@ -355,7 +355,7 @@ None.
355
355
356
356
Returns true if I2S is readable, writable or both (in full-duplex mode), false if not.
357
357
358
-
### `read()`
358
+
### `AdvancedI2S.read()`
359
359
360
360
Returns a sample buffer from the queue for reading. This function can be called in half-duplex input or full-duplex modes. When the buffer is no longer needed, it should be returned to I2S by calling `release()`, see [SampleBuffer](#release) for more details.
361
361
@@ -371,7 +371,7 @@ for (size_t i=0; i<buf.size(); i++) {
371
371
i2s.release(buf);
372
372
```
373
373
374
-
### `dequeue()`
374
+
### `AdvancedI2S.dequeue()`
375
375
376
376
Returns a sample buffer from the queue for writing. This function can be called in half-duplex output or full-duplex modes. When the buffer is done, it can be added to the I2S write queue by calling `write()` (see [I2S](#write))
377
377
@@ -387,7 +387,7 @@ for (size_t i=0; i<buf.size(); i++) {
387
387
i2s.write(buf);
388
388
```
389
389
390
-
### `write()`
390
+
### `AdvancedI2S.write()`
391
391
392
392
Writes a sample buffer to I2S.
393
393
@@ -401,7 +401,7 @@ i2s.write(buf);
401
401
402
402
- A buffer containing the samples (see [SampleBuffer](#samplebuffer)).
403
403
404
-
### `stop()`
404
+
### `AdvancedI2S.stop()`
405
405
406
406
Stops the I2S and releases all of its resources.
407
407
@@ -421,7 +421,7 @@ i2s.stop()
421
421
422
422
Creates a WAV file reader.
423
423
424
-
### `begin()`
424
+
### `WavReader.begin()`
425
425
426
426
Initializes the WAV reader, opens the WAV file and reads the WAV header.
-`int` - **n_buffers** - the number of sample buffers in the queue. See [SampleBuffer](#samplebuffer) for more details.
439
439
-`bool` - **loop* - if true, the WAV reader will loop back to the start of the file, when the end file is reached.
440
440
441
-
### `stop()`
441
+
### `WavReader.stop()`
442
442
443
443
Stops the WAV file and releases all of its resources (include the WAV file handle).
444
444
445
-
### `available()`
445
+
### `WavReader.available()`
446
446
447
447
Returns true if the WAV file has more data to be read.
448
448
449
-
### `read()`
449
+
### `WavReader.read()`
450
450
451
451
Returns a sample buffer from the queue for reading.
452
452
453
-
### `rewind()`
453
+
### `WavReader.rewind()`
454
454
455
455
If `loop` is false, this functions restarts the file read position.
456
456
457
457
## SampleBuffer
458
458
459
-
### Sample
459
+
### `Sample`
460
460
461
461
Represents a single data item in a [`SampleBuffer`](#samplebuffer-1). The `Sample` type is pre-defined by the library as an unsigned short (`uint16_t`) type.
462
462
@@ -476,15 +476,15 @@ for (size_t i=0; i<buf.size(); i++) {
476
476
dac1.write(buf);
477
477
```
478
478
479
-
### `data()`
479
+
### `SampleBuffer.data()`
480
480
481
481
Returns a pointer to the buffer's internal memory. The buffer's internal memory is contiguous and can be used with memcpy, for example.
482
482
483
483
```
484
484
buf.data()
485
485
```
486
486
487
-
### `size()`
487
+
### `SampleBuffer.size()`
488
488
489
489
Returns the buffer size in samples (i.e., the number of samples in the buffer).
490
490
@@ -496,7 +496,7 @@ buf.size()
496
496
497
497
- The buffer size in samples.
498
498
499
-
### `bytes()`
499
+
### `SampleBuffer.bytes()`
500
500
501
501
Returns the buffer size in bytes (i.e., the `number of samples * number of channels * sample size`).
502
502
@@ -508,23 +508,23 @@ buf.bytes()
508
508
509
509
- The buffer size in bytes.
510
510
511
-
### `flush()`
511
+
### `SampleBuffer.flush()`
512
512
513
513
Flushes any cached data for the buffer.
514
514
515
515
```
516
516
buf.flush()
517
517
```
518
518
519
-
### `invalidate()`
519
+
### `SampleBuffer.invalidate()`
520
520
521
521
Invalidats any cached data for the buffer.
522
522
523
523
```
524
524
buf.invalidate()
525
525
```
526
526
527
-
### `timestamp()`
527
+
### `SampleBuffer.timestamp()`
528
528
529
529
Returns the timestamp of the buffer.
530
530
@@ -536,7 +536,7 @@ buf.timestamp()
536
536
537
537
- Timestamp as `int`.
538
538
539
-
### `channels()`
539
+
### `SampleBuffer.channels()`
540
540
541
541
Returns the number of channels in the buffer.
542
542
@@ -548,32 +548,18 @@ buf.channels()
548
548
549
549
- Timestamp as `int`.
550
550
551
-
552
-
### `release()`
553
-
554
-
Releases the buffer back to its memory pool.
555
-
556
-
```
557
-
buf.release()
558
-
```
559
-
560
-
#### Returns
561
-
562
-
`void`.
563
-
564
-
### `setflags()`
551
+
### `SampleBuffer.setflags()`
565
552
566
553
This function is used internally by the library to set the buffer's flags. The flags can be one or both of two options: `DMA_BUFFER_DISCONT` set if the capture was stopped and then restarted, and `DMA_BUFFER_INTRLVD` which indicates that the data in the buffer is interleaved.
567
554
568
555
```
569
556
buf.setflags(uint32_t mask)
570
557
```
571
558
572
-
### `getflags()`
559
+
### `SampleBuffer.getflags()`
573
560
574
561
Returns true if any of the buffer flags specified in the mask argument is set. The flags can be one or both of two options: `DMA_BUFFER_DISCONT` set if the capture was stopped and then restarted, and `DMA_BUFFER_INTRLVD` which indicates that the data in the buffer is interleaved.
575
562
576
-
577
563
```
578
564
buf.getflags(uint32_t mask)
579
565
```
@@ -582,7 +568,7 @@ buf.getflags(uint32_t mask)
582
568
583
569
Returns true if any of the buffer flags specified in the mask argument is set, otherwise returns false.
584
570
585
-
### `clrflags(uin32_t mask)`
571
+
### `SampleBuffer.clrflags()`
586
572
587
573
Clears the buffer flags specified in the mask argument.
0 commit comments