summaryrefslogtreecommitdiffstats
path: root/GUI
diff options
context:
space:
mode:
Diffstat (limited to 'GUI')
-rw-r--r--GUI/GUI/GUI/BrowserSource.h19
-rw-r--r--GUI/GUI/GUI/WhisperCPP.cpp1
-rw-r--r--GUI/package.ps11
3 files changed, 18 insertions, 3 deletions
diff --git a/GUI/GUI/GUI/BrowserSource.h b/GUI/GUI/GUI/BrowserSource.h
index 0334088..6387d1c 100644
--- a/GUI/GUI/GUI/BrowserSource.h
+++ b/GUI/GUI/GUI/BrowserSource.h
@@ -17,6 +17,9 @@
#include <stdint.h>
+#include <filesystem>
+#include <fstream>
+
#include OATPP_CODEGEN_BEGIN(DTO)
class AppDto : public oatpp::DTO
@@ -24,7 +27,7 @@ class AppDto : public oatpp::DTO
DTO_INIT(AppDto, DTO)
DTO_FIELD(Int32, statusCode);
- DTO_FIELD(String, message);
+ DTO_FIELD(String, transcript);
};
#include OATPP_CODEGEN_END(DTO)
@@ -39,12 +42,21 @@ public:
{}
public:
- ENDPOINT("GET", "/", root) {
+ ENDPOINT("GET", "/api/transcript", transcription) {
auto dto = AppDto::createShared();
dto->statusCode = 200;
- dto->message = "Hello World!";
+ dto->transcript = "Hello World!";
+
return createDtoResponse(Status::CODE_200, dto);
}
+
+ ENDPOINT("GET", "/", root) {
+ auto html_path = std::filesystem::path("Resources/BrowserSource/index.html");
+ std::ifstream html_ifs(html_path);
+ std::vector<char> resp(4096 * 16, 0);
+ html_ifs.read(resp.data(), resp.size());
+ return createResponse(Status::CODE_200, resp.data());
+ }
};
#include OATPP_CODEGEN_END(ApiController)
@@ -60,3 +72,4 @@ private:
const uint16_t port_;
wxTextCtrl* const out_;
};
+
diff --git a/GUI/GUI/GUI/WhisperCPP.cpp b/GUI/GUI/GUI/WhisperCPP.cpp
index c532123..2e872f9 100644
--- a/GUI/GUI/GUI/WhisperCPP.cpp
+++ b/GUI/GUI/GUI/WhisperCPP.cpp
@@ -320,6 +320,7 @@ void WhisperCPP::Start(const AppConfig& c) {
static const std::vector<std::string> banned_words{
" [BLANK_AUDIO]",
" [SOUND]",
+ " [ Silence ]",
};
const sSegment* const segments = results->getSegments();
diff --git a/GUI/package.ps1 b/GUI/package.ps1
index 7e5d2e9..bac7147 100644
--- a/GUI/package.ps1
+++ b/GUI/package.ps1
@@ -84,6 +84,7 @@ cp -Recurse ../Scripts TaSTT/Resources/Scripts
cp -Recurse ../Shaders TaSTT/Resources/Shaders
cp -Recurse ../Sounds TaSTT/Resources/Sounds
cp -Recurse ../UnityAssets TaSTT/Resources/UnityAssets
+cp -Recurse ../BrowserSource TaSTT/Resources/BrowserSource
cp GUI/x64/$release/GUI.exe TaSTT/TaSTT.exe
cp GUI/GUI/Whisper/Whisper.dll TaSTT/Whisper.dll
mkdir TaSTT/Resources/Models