Spaces:
Running
Running
Yurii Paniv
commited on
Commit
•
6452277
1
Parent(s):
f7c8bb8
Theme improvements
Browse files- static/main.js +3 -3
- templates/hello.html +8 -4
static/main.js
CHANGED
@@ -13,12 +13,12 @@ function resultProcess(data) {
|
|
13 |
resultNode.textContent = `Довжина тексту: ${data.length} \n
|
14 |
Текст: ${data}
|
15 |
`;
|
16 |
-
actionButton.textContent = "
|
17 |
actionButton.disabled = false;
|
18 |
}
|
19 |
|
20 |
function exportWAV(blob) {
|
21 |
-
actionButton.textContent = "
|
22 |
var data = new FormData()
|
23 |
data.append('file', blob);
|
24 |
fetch(`./recognize`, { method: "POST", body: data })
|
@@ -29,7 +29,7 @@ function record() {
|
|
29 |
|
30 |
var constraints = { audio: true, video: false }
|
31 |
navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
|
32 |
-
actionButton.textContent = "
|
33 |
actionButton.disabled = true;
|
34 |
/*
|
35 |
create an audio context after getUserMedia is called
|
|
|
13 |
resultNode.textContent = `Довжина тексту: ${data.length} \n
|
14 |
Текст: ${data}
|
15 |
`;
|
16 |
+
actionButton.textContent = "Почати запис (3 сек)";
|
17 |
actionButton.disabled = false;
|
18 |
}
|
19 |
|
20 |
function exportWAV(blob) {
|
21 |
+
actionButton.textContent = "Обробляється..."
|
22 |
var data = new FormData()
|
23 |
data.append('file', blob);
|
24 |
fetch(`./recognize`, { method: "POST", body: data })
|
|
|
29 |
|
30 |
var constraints = { audio: true, video: false }
|
31 |
navigator.mediaDevices.getUserMedia(constraints).then(function (stream) {
|
32 |
+
actionButton.textContent = "Запис..."
|
33 |
actionButton.disabled = true;
|
34 |
/*
|
35 |
create an audio context after getUserMedia is called
|
templates/hello.html
CHANGED
@@ -10,10 +10,14 @@
|
|
10 |
</head>
|
11 |
|
12 |
<body>
|
13 |
-
<
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
17 |
<script src="https://cdn.rawgit.com/mattdiamond/Recorderjs/08e7abd9/dist/recorder.js"></script>
|
18 |
<script src="/static/main.js"></script>
|
19 |
</body>
|
|
|
10 |
</head>
|
11 |
|
12 |
<body>
|
13 |
+
<div class="container">
|
14 |
+
<div class="text-center">
|
15 |
+
<h1>Демо розпізнавання української мови</h1>
|
16 |
+
<p>Говоріть 3 секунди після натискання на кнопку, тоді отримаєте результат</p>
|
17 |
+
<button class="btn btn-primary" id="action" onclick="handleAction()">Почати запис (3 сек)</button>
|
18 |
+
<div id="result"></div>
|
19 |
+
</div>
|
20 |
+
</div>
|
21 |
<script src="https://cdn.rawgit.com/mattdiamond/Recorderjs/08e7abd9/dist/recorder.js"></script>
|
22 |
<script src="/static/main.js"></script>
|
23 |
</body>
|