Skip to content

Commit 789b863

Browse files
committed
OutputMixer support writeSilence
1 parent 88c546e commit 789b863

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/AudioTools/AudioOutput.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,23 @@ class OutputMixer : public Print {
444444
size_bytes = size;
445445
}
446446

447+
/// Sets the Output Stream index
448+
void setIndex(int idx){
449+
stream_idx = idx;
450+
}
451+
452+
size_t writeSilence(int bytes) override {
453+
if (bytes == 0) return 0;
454+
byte silence[bytes] = {0};
455+
return write(stream_idx, silence, bytes);
456+
}
457+
458+
size_t writeSilence(int idx, int bytes){
459+
if (bytes == 0) return 0;
460+
byte silence[bytes] = {0};
461+
return write(idx, silence, bytes);
462+
}
463+
447464
protected:
448465
Vector<RingBuffer<T> *> buffers{0};
449466
Vector<T> output{0};

0 commit comments

Comments
 (0)