Fix windows text edit speech recognition

parent f2e9760c
Pipeline #52978 canceled with stage
......@@ -524,7 +524,6 @@ void VideoTextEdit::mouseReleaseEvent(QMouseEvent *e)
// Selection already ends with a space
return;
}
qDebug()<<"=== LAST CHARACTER: "<<document()->characterAt(end);
cursor.setPosition(start);
cursor.movePosition(QTextCursor::StartOfWord, QTextCursor::MoveAnchor);
cursor.setPosition(end, QTextCursor::KeepAnchor);
......@@ -759,8 +758,11 @@ void TextBasedEdit::startRecognition()
m_errorString.clear();
m_visualEditor->cleanup();
//m_visualEditor->insertHtml(QStringLiteral("<body>"));
#ifdef Q_OS_WIN
QString pyExec = QStandardPaths::findExecutable(QStringLiteral("python"));
#else
QString pyExec = QStandardPaths::findExecutable(QStringLiteral("python3"));
#endif
if (pyExec.isEmpty()) {
showMessage(i18n("Cannot find python3, please install it on your system."), KMessageWidget::Warning);
return;
......@@ -789,16 +791,6 @@ void TextBasedEdit::startRecognition()
}
m_speechJob.reset(new QProcess(this));
/*
#ifdef Q_OS_WIN
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
QDir pythonDir(QFileInfo(pyExec).absolutePath());
env.insert("PYTHONHOME", pythonDir.absolutePath());
pythonDir.cd(QStringLiteral("Lib"));
env.insert("PYTHONPATH", pythonDir.absolutePath());
m_speechJob->setProcessEnvironment(env);
#endif
*/
showMessage(i18n("Starting speech recognition"), KMessageWidget::Information);
qApp->processEvents();
QString modelDirectory = KdenliveSettings::vosk_folder_path();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment