From 8c69df689a9327b634f765f11984a76133d3777e Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Tue, 15 Nov 2022 18:07:58 +0000 Subject: minor audioin improvements --- audioin/src/ofApp.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'audioin/src/ofApp.cpp') diff --git a/audioin/src/ofApp.cpp b/audioin/src/ofApp.cpp index 4535c3c..cf454ce 100644 --- a/audioin/src/ofApp.cpp +++ b/audioin/src/ofApp.cpp @@ -9,7 +9,9 @@ void ofApp::setup(){ ofEnableAlphaBlending(); ofSetVerticalSync(true); - blockSize = SAMPLERATE / (frameRate*20); //200 + blockSize = SAMPLERATE / (frameRate*10); //80 + + ofSoundStreamListDevices(); soundStream.setup(this,0, 1, SAMPLERATE, blockSize, 1); @@ -17,6 +19,8 @@ void ofApp::setup(){ vScale=3.0f; hScale=8.0f; + + lineWidth=2.0f; } void ofApp::update(){ @@ -30,6 +34,8 @@ int frameNum=0; void ofApp::draw(){ ofBackground(0); + ofSetLineWidth(lineWidth); + ofPushMatrix(); ofTranslate(0,ofGetHeight()/2); @@ -37,16 +43,19 @@ void ofApp::draw(){ ofScale(1.0f,ofGetHeight()*vScale); ofPolyline line; + + line.addVertex(0,buffer[0]); float i=0.0f; while (i