dmed-voice-assistant 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -0
- package/package.json +70 -0
- package/src/VoiceAssistant/index.js +45 -0
- package/src/VoiceAssistant/recognition.js +952 -0
- package/src/VoiceAssistant/recorder.js +575 -0
package/README.md
ADDED
package/package.json
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"name": "dmed-voice-assistant",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"main": "src/VoiceAssistant/index.js",
|
5
|
+
"files": [
|
6
|
+
"src/VoiceAssistant"
|
7
|
+
],
|
8
|
+
"dependencies": {
|
9
|
+
"@emotion/react": "^11.13.5",
|
10
|
+
"@emotion/styled": "^11.13.5",
|
11
|
+
"@mui/material": "^6.1.10",
|
12
|
+
"@mui/x-date-pickers": "^7.23.1",
|
13
|
+
"@testing-library/jest-dom": "^5.17.0",
|
14
|
+
"@testing-library/react": "^13.4.0",
|
15
|
+
"@testing-library/user-event": "^13.5.0",
|
16
|
+
"dayjs": "^1.11.13",
|
17
|
+
"react": "^18.3.1",
|
18
|
+
"react-dom": "^18.3.1",
|
19
|
+
"react-scripts": "5.0.1",
|
20
|
+
"recorder-js": "^1.0.7",
|
21
|
+
"web-vitals": "^2.1.4"
|
22
|
+
},
|
23
|
+
"scripts": {
|
24
|
+
"start": "react-scripts start",
|
25
|
+
"build": "npx babel src/VoiceAssistant --out-dir dist --copy-files",
|
26
|
+
"build:main": "NODE_OPTIONS=--openssl-legacy-provider CI=false react-scripts build",
|
27
|
+
"test": "react-scripts test",
|
28
|
+
"eject": "react-scripts eject",
|
29
|
+
"prepublishOnly": "npm run build"
|
30
|
+
},
|
31
|
+
"eslintConfig": {
|
32
|
+
"extends": [
|
33
|
+
"react-app",
|
34
|
+
"react-app/jest"
|
35
|
+
],
|
36
|
+
"rules": {
|
37
|
+
"no-warning-comments": "off"
|
38
|
+
}
|
39
|
+
},
|
40
|
+
"browserslist": {
|
41
|
+
"production": [
|
42
|
+
">0.2%",
|
43
|
+
"not dead",
|
44
|
+
"not op_mini all"
|
45
|
+
],
|
46
|
+
"development": [
|
47
|
+
"last 1 chrome version",
|
48
|
+
"last 1 firefox version",
|
49
|
+
"last 1 safari version"
|
50
|
+
]
|
51
|
+
},
|
52
|
+
"devDependencies": {
|
53
|
+
"@babel/cli": "^7.26.4",
|
54
|
+
"@babel/core": "^7.26.0",
|
55
|
+
"@babel/preset-env": "^7.26.0",
|
56
|
+
"@babel/preset-react": "^7.26.3",
|
57
|
+
"autoprefixer": "^10.4.20",
|
58
|
+
"postcss": "^8.4.49",
|
59
|
+
"tailwindcss": "^3.4.16"
|
60
|
+
},
|
61
|
+
"keywords": [
|
62
|
+
"react",
|
63
|
+
"voice",
|
64
|
+
"assistant",
|
65
|
+
"dmed",
|
66
|
+
"stt"
|
67
|
+
],
|
68
|
+
"author": "Aleksei Nguen",
|
69
|
+
"license": "MIT"
|
70
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { useState } from "react";
|
2
|
+
import RecorderBox from "./recorder";
|
3
|
+
import Recognition from "./recognition";
|
4
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
5
|
+
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
6
|
+
|
7
|
+
const VoiceAssistant = ({
|
8
|
+
recordListValue = [],
|
9
|
+
recognitionListValue = [],
|
10
|
+
onNewRecordEvent,
|
11
|
+
onRecordDataChange,
|
12
|
+
onNewRecognitionEvent,
|
13
|
+
onRecognitionDataChange,
|
14
|
+
}) => {
|
15
|
+
const [mode, setMode] = useState("recorder");
|
16
|
+
|
17
|
+
return (
|
18
|
+
<>
|
19
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
20
|
+
{
|
21
|
+
mode === 'recorder' &&
|
22
|
+
<RecorderBox
|
23
|
+
mode={mode}
|
24
|
+
setMode={setMode}
|
25
|
+
recordHistoryList={recordListValue}
|
26
|
+
onNewRecordEvent={onNewRecordEvent}
|
27
|
+
onRecordDataChange={onRecordDataChange}
|
28
|
+
/>
|
29
|
+
}
|
30
|
+
{
|
31
|
+
mode === 'recognition' &&
|
32
|
+
<Recognition
|
33
|
+
mode={mode}
|
34
|
+
setMode={setMode}
|
35
|
+
recognitionHistoryList={recognitionListValue}
|
36
|
+
onNewRecognitionEvent={onNewRecognitionEvent}
|
37
|
+
onRecognitionDataChange={onRecognitionDataChange}
|
38
|
+
/>
|
39
|
+
}
|
40
|
+
</LocalizationProvider>
|
41
|
+
</>
|
42
|
+
);
|
43
|
+
};
|
44
|
+
|
45
|
+
export default VoiceAssistant;
|