Commit f5fa4ef3 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Make speech recognition work with custom model folder

parent 2f605450
Pipeline #50318 canceled with stage
......@@ -128,7 +128,10 @@ void SpeechDialog::slotProcessSpeech(const std::shared_ptr<TimelineItemModel> &t
speech_info->setMessageType(KMessageWidget::Information);
speech_info->setText(i18n("Starting speech recognition"));
qApp->processEvents();
QString modelDirectory = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("speechmodels"), QStandardPaths::LocateDirectory);
QString modelDirectory = KdenliveSettings::vosk_folder_path();
if (modelDirectory.isEmpty()) {
modelDirectory = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("speechmodels"), QStandardPaths::LocateDirectory);
}
qDebug()<<"==== ANALYSIS SPEECH: "<<modelDirectory<<" - "<<language<<" - "<<audio<<" - "<<speech;
speechJob.start(pyExec, {speechScript, modelDirectory, language, audio, speech});
speechJob.waitForFinished();
......
......@@ -103,7 +103,10 @@ void TextBasedEdit::startRecognition()
info_message->setMessageType(KMessageWidget::Information);
info_message->setText(i18n("Starting speech recognition"));
qApp->processEvents();
QString modelDirectory = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("speechmodels"), QStandardPaths::LocateDirectory);
QString modelDirectory = KdenliveSettings::vosk_folder_path();
if (modelDirectory.isEmpty()) {
modelDirectory = QStandardPaths::locate(QStandardPaths::AppDataLocation, QStringLiteral("speechmodels"), QStandardPaths::LocateDirectory);
}
qDebug()<<"==== ANALYSIS SPEECH: "<<modelDirectory<<" - "<<language;
m_sourceUrl.clear();
......
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