[Clam-devel] embedded networks api : ask for proposals
Pau Arumi
parumi at iua.upf.edu
Thu Apr 5 12:15:30 PDT 2007
Zach,
before going into UI and any further or in i'd like to define the
network API for embedded networks, and have working test cases.
So to start, if you take a look at this network test (copied below):
CLAM/test/FunctionalTests/ProcessingTests/TestStreamingSMSAnalysisSynthesis.cxx
In order to discuss the API, how would you re-write this test in order
to have the Analysis in a subnetwork?
I think the first test to implement shouldn't be this one, but
networks with audioports only.
pau
void testAnalysisSynthesisInaNetwork()
{
CLAM::Network net;
CLAM::FreewheelingNetworkPlayer * player = new
CLAM::FreewheelingNetworkPlayer;
net.SetPlayer( player ); // network owns the player memory
net.AddProcessing( "Source", new CLAM::AudioSource );
net.AddProcessing( "Sink", new CLAM::AudioSink );
net.AddProcessing( "Analysis", new CLAM::SMSAnalysisCore );
net.AddProcessing( "Synthesis", new CLAM::SMSSynthesis );
net.ConnectPorts("Source.AudioOut", "Analysis.Input Audio");
net.ConnectPorts("Analysis.Sinusoidal Peaks", "Synthesis.InputSinPeaks");
net.ConnectPorts("Analysis.Residual Spectrum",
"Synthesis.InputResSpectrum");
net.ConnectPorts("Synthesis.OutputAudio", "Sink.AudioIn");
net.ConfigureProcessing("Analysis", helperAnalysisConfigInstance() );
net.ConfigureProcessing("Synthesis", helperSynthesisConfigInstance() );
std::string inputFile = GetTestDataDirectory("Elvis.wav");
std::string baseOutputFile =
GetTestDataDirectory("SMSTests/out_sms_net_stream");
player->InputFile(inputFile);
player->OutputFile(baseOutputFile+"_result.wav");
net.Start();
net.Stop();
std::string whyDifferents;
bool equals=helperCompareTwoAudioFiles(
baseOutputFile+".wav", baseOutputFile+"_result.wav",
whyDifferents);
CPPUNIT_ASSERT_MESSAGE(whyDifferents, equals);
}
More information about the clam-devel
mailing list