Spaces:
Running
Running
Update index.html
Browse files- index.html +24 -10
index.html
CHANGED
@@ -152,13 +152,13 @@
|
|
152 |
}
|
153 |
|
154 |
.asr-item input.role-field {
|
155 |
-
width:
|
156 |
padding: 5px;
|
157 |
border: 1px solid #555;
|
158 |
background-color: #444;
|
159 |
color: #eaeaea;
|
160 |
border-radius: 4px;
|
161 |
-
flex: 0 0
|
162 |
text-align: center;
|
163 |
}
|
164 |
|
@@ -347,11 +347,11 @@
|
|
347 |
您的浏览器不支持 video 标签。
|
348 |
</video>
|
349 |
|
350 |
-
<!--
|
351 |
<div style="margin: 10px 0;">
|
352 |
-
<label
|
353 |
-
<label><input type="
|
354 |
-
<label><input type="
|
355 |
</div>
|
356 |
|
357 |
<div class="buttons-container">
|
@@ -409,7 +409,8 @@
|
|
409 |
}
|
410 |
|
411 |
// 获取选择的任务类型
|
412 |
-
const
|
|
|
413 |
|
414 |
document.getElementById('uploadBtn').disabled = true;
|
415 |
document.getElementById('uploadBtn').innerText = '转写中...';
|
@@ -433,7 +434,8 @@
|
|
433 |
|
434 |
const formData = new FormData();
|
435 |
formData.append('file', file);
|
436 |
-
formData.append('
|
|
|
437 |
xhr.send(formData);
|
438 |
}
|
439 |
|
@@ -534,10 +536,12 @@
|
|
534 |
<input type="number" value="${entry.end.toFixed(1)}" step="0.1" min="0" class="end-time">
|
535 |
</div>
|
536 |
|
537 |
-
<input type="text" value="
|
538 |
|
539 |
<input type="text" value="${entry.text}" placeholder="文本" class="text-field">
|
540 |
|
|
|
|
|
541 |
<label>
|
542 |
<input type="checkbox" ${entry.drop ? 'checked' : ''}> 丢弃
|
543 |
</label>
|
@@ -545,7 +549,9 @@
|
|
545 |
|
546 |
const startInput = div.querySelector('.start-time');
|
547 |
const endInput = div.querySelector('.end-time');
|
|
|
548 |
const textInput = div.querySelector('input.text-field');
|
|
|
549 |
const dropCheckbox = div.querySelector('input[type="checkbox"]');
|
550 |
const playButton = div.querySelector('.play-button');
|
551 |
|
@@ -557,10 +563,18 @@
|
|
557 |
entry.end = parseFloat(endInput.value);
|
558 |
});
|
559 |
|
|
|
|
|
|
|
|
|
560 |
textInput.addEventListener('input', () => {
|
561 |
entry.text = textInput.value;
|
562 |
});
|
563 |
|
|
|
|
|
|
|
|
|
564 |
dropCheckbox.addEventListener('change', () => {
|
565 |
entry.drop = dropCheckbox.checked;
|
566 |
});
|
@@ -599,7 +613,7 @@
|
|
599 |
const start = formatTime(entry.start);
|
600 |
const end = formatTime(entry.end);
|
601 |
content += `${start} --> ${end}\n`;
|
602 |
-
content += `${entry.text}\n\n`;
|
603 |
});
|
604 |
}
|
605 |
|
|
|
152 |
}
|
153 |
|
154 |
.asr-item input.role-field {
|
155 |
+
width: 70px;
|
156 |
padding: 5px;
|
157 |
border: 1px solid #555;
|
158 |
background-color: #444;
|
159 |
color: #eaeaea;
|
160 |
border-radius: 4px;
|
161 |
+
flex: 0 0 70px; /* 保持宽度固定为 100px */
|
162 |
text-align: center;
|
163 |
}
|
164 |
|
|
|
347 |
您的浏览器不支持 video 标签。
|
348 |
</video>
|
349 |
|
350 |
+
<!-- 相关任务栏 -->
|
351 |
<div style="margin: 10px 0;">
|
352 |
+
<label>附加任务(勾选):</label>
|
353 |
+
<label><input type="checkbox" id="speakerRecognition"> 说话人识别</label>
|
354 |
+
<label><input type="checkbox" id="englishTranslation"> 中英翻译</label>
|
355 |
</div>
|
356 |
|
357 |
<div class="buttons-container">
|
|
|
409 |
}
|
410 |
|
411 |
// 获取选择的任务类型
|
412 |
+
const speakerRecognition = document.getElementById('speakerRecognition').checked;
|
413 |
+
const englishTranslation = document.getElementById('englishTranslation').checked;
|
414 |
|
415 |
document.getElementById('uploadBtn').disabled = true;
|
416 |
document.getElementById('uploadBtn').innerText = '转写中...';
|
|
|
434 |
|
435 |
const formData = new FormData();
|
436 |
formData.append('file', file);
|
437 |
+
formData.append('speakerRecognition', speakerRecognition); // 将说话人识别任务添加到请求中
|
438 |
+
formData.append('englishTranslation', englishTranslation); // 将英文翻译任务添加到请求中
|
439 |
xhr.send(formData);
|
440 |
}
|
441 |
|
|
|
536 |
<input type="number" value="${entry.end.toFixed(1)}" step="0.1" min="0" class="end-time">
|
537 |
</div>
|
538 |
|
539 |
+
<input type="text" value="${entry.role}" placeholder="角色" class="role-field">
|
540 |
|
541 |
<input type="text" value="${entry.text}" placeholder="文本" class="text-field">
|
542 |
|
543 |
+
<input type="text" value="${entry.trans}" placeholder="翻译" class="trans-field">
|
544 |
+
|
545 |
<label>
|
546 |
<input type="checkbox" ${entry.drop ? 'checked' : ''}> 丢弃
|
547 |
</label>
|
|
|
549 |
|
550 |
const startInput = div.querySelector('.start-time');
|
551 |
const endInput = div.querySelector('.end-time');
|
552 |
+
const roleInput = div.querySelector('input.role-field');
|
553 |
const textInput = div.querySelector('input.text-field');
|
554 |
+
const transInput = div.querySelector('input.trans-field');
|
555 |
const dropCheckbox = div.querySelector('input[type="checkbox"]');
|
556 |
const playButton = div.querySelector('.play-button');
|
557 |
|
|
|
563 |
entry.end = parseFloat(endInput.value);
|
564 |
});
|
565 |
|
566 |
+
roleInput.addEventListener('input', () => {
|
567 |
+
entry.role = roleInput.value;
|
568 |
+
});
|
569 |
+
|
570 |
textInput.addEventListener('input', () => {
|
571 |
entry.text = textInput.value;
|
572 |
});
|
573 |
|
574 |
+
transInput.addEventListener('input', () => {
|
575 |
+
entry.trans = transInput.value;
|
576 |
+
});
|
577 |
+
|
578 |
dropCheckbox.addEventListener('change', () => {
|
579 |
entry.drop = dropCheckbox.checked;
|
580 |
});
|
|
|
613 |
const start = formatTime(entry.start);
|
614 |
const end = formatTime(entry.end);
|
615 |
content += `${start} --> ${end}\n`;
|
616 |
+
content += `${entry.text}\n${entry.trans}\n\n`;
|
617 |
});
|
618 |
}
|
619 |
|