ContextXAudio::~ContextXAudio()
{
	CI_ASSERT_MSG( mMasteringVoice, "Expected to have a valid mastering voice" );

	// first ensure the IXAudio2SourceVoice destroyed by uninitializing the OutputDeviceNodeXAudio
	uninitializeNode( mOutput );

	mMasteringVoice->DestroyVoice();
	mXAudio->Release();
}
Example #2
0
void Context::setOutput( const OutputNodeRef &output )
{
	if( mOutput ) {
		if( output && mOutput->getOutputFramesPerBlock() != output->getOutputFramesPerBlock() || mOutput->getOutputSampleRate() != output->getOutputSampleRate() ) {
			// params changed used in sizing buffers, uninit all connected nodes so they can reconfigure
			uninitializeAllNodes();
		}
		else {
			// params are the same, so just uninitialize the old output.
			uninitializeNode( mOutput );
		}
	}

	mOutput = output;

	if( mOutput )
		initializeAllNodes();
}