Spaces:
Sleeping
Sleeping
Update Web/script.js
Browse files- Web/script.js +12 -2
Web/script.js
CHANGED
|
@@ -213,9 +213,19 @@ async function analyzeAudio(blob) {
|
|
| 213 |
if (data[0]?.volume === "augmented") {
|
| 214 |
messageVolume = "The detected speech volume was low, so a volume augmentation was applied before analysis. ";
|
| 215 |
}
|
| 216 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
} catch (err) {
|
| 218 |
-
responseBox.innerHTML = `<
|
| 219 |
console.error(err);
|
| 220 |
}
|
| 221 |
}
|
|
|
|
| 213 |
if (data[0]?.volume === "augmented") {
|
| 214 |
messageVolume = "The detected speech volume was low, so a volume augmentation was applied before analysis. ";
|
| 215 |
}
|
| 216 |
+
const volumeColor = "yellow";
|
| 217 |
+
let predictionColor = message.includes("Genuine") ? "green" : "red";
|
| 218 |
+
|
| 219 |
+
responseBox.innerHTML = `
|
| 220 |
+
<div style="font-size: 1.1rem; margin-bottom: 6px; color:${volumeColor};">
|
| 221 |
+
${messageVolume}
|
| 222 |
+
</div>
|
| 223 |
+
<div style="font-size: 1.25rem; font-weight:600; color:${predictionColor};">
|
| 224 |
+
${message}
|
| 225 |
+
</div>
|
| 226 |
+
`;
|
| 227 |
} catch (err) {
|
| 228 |
+
responseBox.innerHTML = `<div style="font-size: 1.25rem; font-weight:600; color:red;">/!\ Analysis failed.</div>`;
|
| 229 |
console.error(err);
|
| 230 |
}
|
| 231 |
}
|