Audio Processing Framework (APF) version 0.5.0
audiofile_simpleprocessor.cpp
// Usage example for the MimoProcessor reading from and writing to multichannel
// audio files.
// First the policy ...
// ... then the SimpleProcessor.
#include "simpleprocessor.h"
int main(int argc, char *argv[])
{
const size_t blocksize = 65536;
if (argc < 4)
{
std::cerr << "Error: too few arguments!" << std::endl;
std::cout << "Usage: " << argv[0]
<< " infilename outfilename outchannels [threads]" << std::endl;
return 42;
}
std::string infilename = argv[1];
std::string outfilename = argv[2];
if (argc >= 5)
{
e.set("threads", argv[4]);
}
SndfileHandle in(infilename, SFM_READ);
e.set("in_channels", in.channels());
e.set("out_channels", apf::str::S2RV<int>(argv[3]));
e.set("block_size", blocksize);
e.set("sample_rate", in.samplerate());
SimpleProcessor engine(e);
return mimoprocessor_file_io(engine, infilename , outfilename);
}
Helper function for multichannel soundfile reading/writing.
int mimoprocessor_file_io(Processor &processor, const std::string &infilename, const std::string &outfilename)
Use MimoProcessor-based object with multichannel audio file input and output.
C policy (= pointer based) for MimoProcessor's audio_interface.
A "dictionary" for parameters.
Definition: parameter_map.h:68
const std::string & set(const std::string &k, const T &v)
Set value.