@@ -86,6 +86,8 @@ ofxVisualProgramming::ofxVisualProgramming(){
8686 newFileCounter = 0 ;
8787
8888 audioSampleRate = 44100 ;
89+ audioBufferSize = 1024 ;
90+ audioNumBuffers = 4 ;
8991 audioGUIINIndex = -1 ;
9092 audioGUIOUTIndex = -1 ;
9193 bpm = 120 ;
@@ -1270,7 +1272,14 @@ void ofxVisualProgramming::loadPatch(string patchFile){
12701272 engine = new pdsp::Engine ();
12711273
12721274 soundStreamIN.close ();
1275+ #if defined(TARGET_WIN32)
1276+ audioDevices = soundStreamIN.getDeviceList (ofSoundDevice::Api::MS_DS);
1277+ #elif defined(TARGET_OSX)
1278+ audioDevices = soundStreamIN.getDeviceList (ofSoundDevice::Api::OSX_CORE);
1279+ #else
12731280 audioDevices = soundStreamIN.getDeviceList ();
1281+ #endif
1282+
12741283 audioDevicesStringIN.clear ();
12751284 audioDevicesID_IN.clear ();
12761285 audioDevicesStringOUT.clear ();
@@ -1347,7 +1356,7 @@ void ofxVisualProgramming::loadPatch(string patchFile){
13471356
13481357 engine->setOutputDeviceID (audioDevices[audioOUTDev].deviceID );
13491358 engine->setInputDeviceID (audioDevices[audioINDev].deviceID );
1350- engine->setup (audioSampleRate, audioBufferSize, 3 );
1359+ engine->setup (audioSampleRate, audioBufferSize, audioNumBuffers );
13511360 engine->sequencer .setTempo (bpm);
13521361
13531362 ofLog (OF_LOG_NOTICE," [verbose]------------------- Soundstream INPUT Started on" );
@@ -1573,7 +1582,7 @@ void ofxVisualProgramming::activateDSP(){
15731582
15741583 engine->setOutputDeviceID (audioDevices[audioOUTDev].deviceID );
15751584 engine->setInputDeviceID (audioDevices[audioINDev].deviceID );
1576- engine->setup (audioSampleRate, audioBufferSize, 3 );
1585+ engine->setup (audioSampleRate, audioBufferSize, audioNumBuffers );
15771586 engine->sequencer .setTempo (bpm);
15781587
15791588 bool found = weAlreadyHaveObject (" audio device" );
0 commit comments