Skip to content

Commit 6f78be3

Browse files
authored
Merge pull request #60 from smeyfroi/sm/null-output
Add NullOutput to discard audio
2 parents 4da91a4 + d1e68b0 commit 6f78be3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/SoundObjects/NullOutput.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// NullObject.hpp
3+
//
4+
// Created by smeyfroi on 2025-04-20.
5+
//
6+
#pragma once
7+
8+
#include "ofxSoundObject.h"
9+
10+
// An output sink that discards incoming audio when a SoundObject stream
11+
// is being used live for audio analysis and output is not needed.
12+
//
13+
// ...
14+
// soundStream.setup(settings);
15+
// soundStream.setInput(deviceInput);
16+
// soundStream.setOutput(nullOutput);
17+
//
18+
// deviceInput.connectTo(*this).connectTo(nullOutput);
19+
//
20+
class NullOutput: public ofxSoundOutput {
21+
void process(ofSoundBuffer &input, ofSoundBuffer &output) override {};
22+
};

0 commit comments

Comments
 (0)