-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsubtitleUpdater.cpp
More file actions
36 lines (30 loc) · 1.11 KB
/
subtitleUpdater.cpp
File metadata and controls
36 lines (30 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once
#include "stdafx.h"
#include "subtitleUpdater.h"
#include "AzureSpeechAPI.h"
subtitleUpdater::subtitleUpdater() {}
subtitleUpdater::~subtitleUpdater() {}
void subtitleUpdater::process() {
AzureSpeechAPI *speech = AzureSpeechAPI::getInstance();
speech->startRecognition(this);
}
void subtitleUpdater::saveConfig(std::string key, std::string region, std::string detectionLanguage, std::string translationLanguage, bool recordState, int engineMode, bool showSingleLanguage) {
AzureSpeechAPI* speech = AzureSpeechAPI::getInstance();
speech->setKey(key);
speech->setRegion(region);
speech->setDetectionLanguageCode(detectionLanguage);
speech->setTransaltionLanguageCode(translationLanguage);
speech->setSavingResultState(recordState);
speech->setEngineMode(engineMode);
speech->setShowSingleLanguage(showSingleLanguage);
}
void subtitleUpdater::close() {
AzureSpeechAPI* speech = AzureSpeechAPI::getInstance();
speech->stopRecognition();
emit finished();
}
void subtitleUpdater::updateEngineMode(int engineMode)
{
AzureSpeechAPI* speech = AzureSpeechAPI::getInstance();
speech->setEngineMode(engineMode);
}