I am trying to play a movie and do an audio analysis at the same time, using cinder:audio.
A movie contains sound.
My naive approach to instantiate an audio graph using a default input device
auto ctx = audio::master();
mInputDeviceNode = ctx->createInputDeviceNode();
cout<< "Using " << mInputDeviceNode->getDevice() -> getName() << " audio input" <<endl;
auto monitorFormat = audio::MonitorSpectralNode::Format().fftSize( 1024 ).windowSize( 512 );
mMonitorSpectralNode = ctx->makeNode( new audio::MonitorSpectralNode( monitorFormat ) );
mInputDeviceNode >> mMonitorSpectralNode;
mInputDeviceNode->enable();
ctx->enable();
resulted in
Assertion failed: (status == noErr), function process, file /Users/eight/repos/cinder_0.9.0_mac/src/cinder/audio/cocoa/ContextAudioUnit.cpp, line 281.
Ideally though I would like to have the movie audio serve as my audio graph input. Is this possible?
If not, is it possible to setup the default audio input device to live together with playing a movie?
Thanks.