Commit 13e034bb authored by pbethge's avatar pbethge
Browse files

add some comments on audio handling

parent ec397ec2
......@@ -284,8 +284,8 @@ void ofApp::audioIn(ofSoundBuffer & input) {
ofLogVerbose(PACKAGE) << "Start recording...";
// copy previous buffers to the recording
sampleBuffers = previousBuffers;
sampleBuffers.setMaxLen(numBuffers); // just to make sure (not tested)
recordingCounter = sampleBuffers.size();
sampleBuffers.setMaxLen(numBuffers); // hacky: last step overwrites maxLen
recordingCounter = sampleBuffers.size(); // we already have the previous buffer
// trigger recording in the next function call
recording = true;
recordingStarted = true;
......
......@@ -67,9 +67,9 @@ class ofApp : public ofBaseApp {
// audio
ofSoundStream soundStream;
int inputDevice = -1;
int inputChannel = 0;
std::vector<float> monoBuffer; //< mono inputChannel stream buffer
int inputDevice = -1; // -1 means search for default device
int inputChannel = 0; // 0 means mono, 1 means stereo
  • actually it's 0 is left, 1 is right, 2 is the third channel, etc

    "mono" just means 1 channel no matter what index it may have

    Edited by Dan Wilcox
  • Of course, 0 = left, 1 = right is only traditional. You could have a sound card with 64 inputs and use channels 1 and 64 for your stereo stream if you want. :)

Please register or sign in to reply
std::vector<float> monoBuffer; //< mono inputChannel stream buffer
bool listening = true;
// neural network input parameters
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment