+
VoiceWidget
+
+
+
+
Loaded: {JSON.stringify(isLoaded)}
+
Recording: {JSON.stringify(isRecording)}
+
Error: {JSON.stringify(error !== null)}
+ {error &&
{error.toString()}
}
+
+
+
{
+ if (!!e.target.files?.length) {
+ setIsBusy(true);
+ await processFile(e.target.files[0]);
+ setIsBusy(false);
+ }
+ }}
+ disabled={!isLoaded || isBusy}
+ />
+
+ OR
+
+
+
{recordingElapsedSec}s
+
+
+
+
Transcript:
+
{result?.transcript}
+ {result?.words && (
+
+
+
+ word |
+ startSec |
+ endSec |
+ confidence |
+
+
+
+ {result?.words.map((obj) => (
+
+ {obj.word} |
+ {obj.startSec.toFixed(3)} |
+ {obj.endSec.toFixed(3)} |
+ {obj.confidence.toFixed(3)} |
+
+ ))}
+
+
+ )}
+
+ );
+}
diff --git a/demo/react/src/index.css b/demo/react/src/index.css
new file mode 100644
index 00000000..ec2585e8
--- /dev/null
+++ b/demo/react/src/index.css
@@ -0,0 +1,13 @@
+body {
+ margin: 0;
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
+ 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
+ sans-serif;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+code {
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
+ monospace;
+}
diff --git a/demo/react/src/index.js b/demo/react/src/index.js
new file mode 100644
index 00000000..aeab2f21
--- /dev/null
+++ b/demo/react/src/index.js
@@ -0,0 +1,9 @@
+import React from "react";
+import { createRoot } from "react-dom/client";
+
+import "./index.css";
+import App from "./App";
+
+const container = document.getElementById("root");
+const root = createRoot(container);
+root.render(