/usr/share/doc/libsndobj-dev/examples/denoiser.cpp is in libsndobj-dev 2.6.6.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | // Copyright (c)Victor Lazzarini, 1997-2004
// See License.txt for a disclaimer of all warranties
// and licensing information
#include <SndObj/AudioDefs.h>
#include <iostream>
void Usage(int argc, char** argv);
int
main(int argc, char** argv){
if(argc != 5){
Usage(argc,argv);
return 1;
}
// amount of mask attenuation (dB)
float amount = (float)pow(10, atof(argv[4])/20.f);
// masking file
SndWave inmask(argv[2], READ);
// input file
SndWave infile(argv[1], READ);
// Hamming window
HammingTable window(DEF_FFTSIZE, 0.54f);
// masking table
PVTable table2(DEF_FFTSIZE,&inmask,&window, 0.f, 1.f);
// input signal
SndIn in(&infile);
// PV analysis
PVA anal(&window, &in, 0.6f);
// Masking
PVMask mask(amount, &table2, &anal);
// PV synthesis
PVS synth(&window, &mask);
// output file
SndWave output(argv[3], OVERWRITE, 1);
output.SetOutput(1, &synth);
// processing loop
while(!infile.Eof()){
infile.Read();
in.DoProcess();
anal.DoProcess();
mask.DoProcess();
synth.DoProcess();
output.Write();
}
return 0;
}
void
Usage(int argc, char** argv){
std::cout << "Wrong number of arguments: "
<< argc << ".\n";
std::cout << "Usage:\n" <<
argv[0] << " input.wav mask.wav output.wav noise_atten(dB)\n";
}
|