clive
4th August 2007, 14:38
I am having a problem when running lame as a QProcess.
I have tried using the standard method of placing the commandline params in a QStringList but have moved onto a plain line of text to simplify things for now.
QProcess * lame = new QProcess(this);
connect(lame, SIGNAL(readyReadStandardOutput()), this, SLOT(lameDataAvailable()));
connect(lame, SIGNAL(readyReadStandardError()), this, SLOT(lameErrorAvailable()));
connect(lame, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(lameFinished(int, QProcess::ExitStatus)));
QString tmp = "lame \"-b 112\" \"-m j\" -f \"-V 2\" \"-B 320\" \"" + inFile + "\" \"" + outFile + "\"";
lame->start(tmp);
lame reports this...
lame: -m mode must be s/d/j/f/m not j
if I remove the space between the -m and j thus.. -mj then lame accepts it.
But if I put a --lowpass 18 in the string then lame says it is an unrecognised switch.
But if I use all and any of the lame switches in a terminal they are always accepted okay.
I am running Lame version 3.97 but the problem was the same with an earlier version.
After numerous tests I have come to the conclusion that it is something to do with an environment setting for the QProcess.
I tried setting a TERM=xterm environment setting but it doesn't make any difference.
Does anyone have any idea about what is happening?
Thanks
I have tried using the standard method of placing the commandline params in a QStringList but have moved onto a plain line of text to simplify things for now.
QProcess * lame = new QProcess(this);
connect(lame, SIGNAL(readyReadStandardOutput()), this, SLOT(lameDataAvailable()));
connect(lame, SIGNAL(readyReadStandardError()), this, SLOT(lameErrorAvailable()));
connect(lame, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(lameFinished(int, QProcess::ExitStatus)));
QString tmp = "lame \"-b 112\" \"-m j\" -f \"-V 2\" \"-B 320\" \"" + inFile + "\" \"" + outFile + "\"";
lame->start(tmp);
lame reports this...
lame: -m mode must be s/d/j/f/m not j
if I remove the space between the -m and j thus.. -mj then lame accepts it.
But if I put a --lowpass 18 in the string then lame says it is an unrecognised switch.
But if I use all and any of the lame switches in a terminal they are always accepted okay.
I am running Lame version 3.97 but the problem was the same with an earlier version.
After numerous tests I have come to the conclusion that it is something to do with an environment setting for the QProcess.
I tried setting a TERM=xterm environment setting but it doesn't make any difference.
Does anyone have any idea about what is happening?
Thanks