Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Multimedia
Kdenlive
Commits
aeb264d3
Commit
aeb264d3
authored
Mar 03, 2021
by
Jean-Baptiste Mardelle
Browse files
Fix windows text edit speech recognition
parent
f2e9760c
Pipeline
#52978
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/dialogs/textbasededit.cpp
View file @
aeb264d3
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment