Even though much of the point of translating to C++ was the possible optimization benefits, I think correctness is still the most important at this point. I believe there are still issues I have mentioned elsewhere that needs to be addressed, or have they been handled? Also, in getParams() an if-statement is missing:size_t found = parameters.wavName.find_last_of("/\\");
if (found != std::string::npos)
{
parameters.WavInpDir = parameters.wavName.substr(0, found + 1);
parameters.wavName = parameters.wavName.substr(found + 1);
}
For piped IO, make sure to set input/output stream to binary mode on windows.
#ifdef _WIN32
#include <cstdio>
#include <io.h>
#include <fcntl.h>
#endif
...
if (parameter.STDINPUT || parameter.STDOUTPUT) {
#ifdef _WIN32
_setmode(_fileno(stdin), _O_BINARY);
_setmode(_fileno(stdout), _O_BINARY);
#endif
...
}
This will also make std::cin and std::cout binary, i.e. does not translate linefeed char (LF) to CRLF - leaves it as LF. Works both under g++ and VS.
As for executable size, you may try -Os compiler flag and then "strip lossyWAV.exe". With Visual Studio, the executable doesn't get very large.