maaz-ht
commited on
Commit
·
1e9bcbc
1
Parent(s):
64242ab
imoroved ui
Browse files
streaming-react-app/src/StreamingInterface.css
CHANGED
@@ -3,6 +3,8 @@
|
|
3 |
flex-direction: column;
|
4 |
justify-content: center;
|
5 |
align-items: center;
|
|
|
|
|
6 |
}
|
7 |
|
8 |
.main-container-sra {
|
@@ -11,8 +13,8 @@
|
|
11 |
flex-direction: column;
|
12 |
justify-content: flex-start;
|
13 |
text-align: left;
|
14 |
-
|
15 |
-
|
16 |
border-radius: 8px;
|
17 |
box-shadow: 0px 24px 30px rgba(0, 0, 0, 0.3);
|
18 |
border: 1px solid rgba(0, 0, 0, 0.05);
|
@@ -21,7 +23,7 @@
|
|
21 |
|
22 |
.top-section-sra {
|
23 |
padding-top: 24px;
|
24 |
-
|
25 |
}
|
26 |
|
27 |
.horizontal-padding-sra {
|
@@ -34,12 +36,12 @@
|
|
34 |
flex-direction: column;
|
35 |
gap:10px;
|
36 |
align-items: center;
|
37 |
-
|
38 |
}
|
39 |
|
40 |
.header-icon-sra {
|
41 |
display: block;
|
42 |
-
|
43 |
}
|
44 |
|
45 |
.translation-text-container-sra {
|
@@ -49,5 +51,5 @@
|
|
49 |
}
|
50 |
|
51 |
.text-chunk-sra {
|
52 |
-
|
53 |
}
|
|
|
3 |
flex-direction: column;
|
4 |
justify-content: center;
|
5 |
align-items: center;
|
6 |
+
width: 100%;
|
7 |
+
min-height: 100vh;
|
8 |
}
|
9 |
|
10 |
.main-container-sra {
|
|
|
13 |
flex-direction: column;
|
14 |
justify-content: flex-start;
|
15 |
text-align: left;
|
16 |
+
padding: 16px;
|
17 |
+
padding-bottom: 36px;
|
18 |
border-radius: 8px;
|
19 |
box-shadow: 0px 24px 30px rgba(0, 0, 0, 0.3);
|
20 |
border: 1px solid rgba(0, 0, 0, 0.05);
|
|
|
23 |
|
24 |
.top-section-sra {
|
25 |
padding-top: 24px;
|
26 |
+
padding-bottom: 24px;
|
27 |
}
|
28 |
|
29 |
.horizontal-padding-sra {
|
|
|
36 |
flex-direction: column;
|
37 |
gap:10px;
|
38 |
align-items: center;
|
39 |
+
padding-bottom: 20px;
|
40 |
}
|
41 |
|
42 |
.header-icon-sra {
|
43 |
display: block;
|
44 |
+
padding-right: 12px;
|
45 |
}
|
46 |
|
47 |
.translation-text-container-sra {
|
|
|
51 |
}
|
52 |
|
53 |
.text-chunk-sra {
|
54 |
+
padding-bottom: 12px;
|
55 |
}
|
streaming-react-app/src/StreamingInterface.tsx
CHANGED
@@ -98,8 +98,8 @@ async function requestDisplayMediaAudioStream(
|
|
98 |
}
|
99 |
|
100 |
const buttonLabelMap: {[key in StreamingStatus]: string} = {
|
101 |
-
stopped: 'Start
|
102 |
-
running: 'Stop
|
103 |
starting: 'Starting...',
|
104 |
};
|
105 |
|
@@ -734,13 +734,14 @@ export default function StreamingInterface() {
|
|
734 |
|
735 |
return (
|
736 |
<div className="app-wrapper-sra">
|
737 |
-
<
|
738 |
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
739 |
// @ts-ignore Not sure why it's complaining about complexity here
|
740 |
-
|
|
|
741 |
<div className="main-container-sra">
|
742 |
<Stack direction={{ xs: 'column', md: 'row' }} spacing={6} className="top-section-sra horizontal-padding-sra">
|
743 |
-
|
744 |
<div className="header-container-sra">
|
745 |
<img
|
746 |
src={"./logo.png"}
|
@@ -750,13 +751,13 @@ export default function StreamingInterface() {
|
|
750 |
/>
|
751 |
|
752 |
<div>
|
753 |
-
<Typography variant="h1" fontSize={
|
754 |
Hotdub Real Time Translation
|
755 |
</Typography>
|
756 |
</div>
|
757 |
</div>
|
758 |
|
759 |
-
<Box>
|
760 |
<RoomConfig
|
761 |
roomState={roomState}
|
762 |
serverState={serverState}
|
@@ -781,54 +782,13 @@ export default function StreamingInterface() {
|
|
781 |
{volumeSliderNode}
|
782 |
</Box>
|
783 |
)}
|
784 |
-
</Box>
|
785 |
</Stack>
|
786 |
|
787 |
<Stack spacing="22px" direction="column" sx={{flex:1}}>
|
788 |
{!isSpeaker && (
|
789 |
<>
|
790 |
-
|
791 |
-
<FormLabel id="output-modes-radio-group-label">
|
792 |
-
Model
|
793 |
-
</FormLabel>
|
794 |
-
<FormControl
|
795 |
-
disabled={
|
796 |
-
streamFixedConfigOptionsDisabled ||
|
797 |
-
agentsCapabilities.length === 0
|
798 |
-
}
|
799 |
-
fullWidth
|
800 |
-
sx={{minWidth: '14em'}}>
|
801 |
-
<InputLabel id="model-selector-input-label">
|
802 |
-
Model
|
803 |
-
</InputLabel>
|
804 |
-
<Select
|
805 |
-
labelId="model-selector-input-label"
|
806 |
-
label="Model"
|
807 |
-
onChange={(e: SelectChangeEvent) => {
|
808 |
-
const newAgent =
|
809 |
-
agentsCapabilities.find(
|
810 |
-
(agent) => e.target.value === agent.name,
|
811 |
-
) ?? null;
|
812 |
-
if (newAgent == null) {
|
813 |
-
console.error(
|
814 |
-
'Unable to find agent with name',
|
815 |
-
e.target.value,
|
816 |
-
);
|
817 |
-
}
|
818 |
-
setAgentAndUpdateParams(newAgent);
|
819 |
-
}}
|
820 |
-
value={model ?? ''}>
|
821 |
-
{agentsCapabilities.map((agent) => (
|
822 |
-
<MenuItem value={agent.name} key={agent.name}>
|
823 |
-
Hotdub Real Time Translation
|
824 |
-
</MenuItem>
|
825 |
-
))}
|
826 |
-
</Select>
|
827 |
-
</FormControl>
|
828 |
-
|
829 |
-
</Stack>
|
830 |
-
|
831 |
-
<Stack spacing={0.5}>
|
832 |
<FormLabel id="output-modes-radio-group-label">
|
833 |
Output
|
834 |
</FormLabel>
|
@@ -836,7 +796,7 @@ export default function StreamingInterface() {
|
|
836 |
<Box sx={{paddingTop: 2, paddingBottom: 1}}>
|
837 |
<FormControl fullWidth sx={{minWidth: '14em'}}>
|
838 |
<InputLabel id="target-selector-input-label">
|
839 |
-
|
840 |
</InputLabel>
|
841 |
<Select
|
842 |
labelId="target-selector-input-label"
|
@@ -934,14 +894,56 @@ export default function StreamingInterface() {
|
|
934 |
</Grid>
|
935 |
</Stack>
|
936 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
937 |
<Stack
|
938 |
direction="row"
|
939 |
-
spacing={2}
|
940 |
-
justifyContent="space-between">
|
941 |
-
<Box
|
942 |
<FormControl disabled={streamFixedConfigOptionsDisabled}>
|
943 |
<FormLabel id="input-source-radio-group-label">
|
944 |
-
|
945 |
</FormLabel>
|
946 |
<RadioGroup
|
947 |
aria-labelledby="input-source-radio-group-label"
|
@@ -964,7 +966,7 @@ export default function StreamingInterface() {
|
|
964 |
</FormControl>
|
965 |
</Box>
|
966 |
|
967 |
-
<Box
|
968 |
<FormControl disabled={streamFixedConfigOptionsDisabled}>
|
969 |
<FormLabel>Options</FormLabel>
|
970 |
<FormControlLabel
|
@@ -982,7 +984,7 @@ export default function StreamingInterface() {
|
|
982 |
}
|
983 |
/>
|
984 |
}
|
985 |
-
label="Noise
|
986 |
/>
|
987 |
<FormControlLabel
|
988 |
control={
|
@@ -999,7 +1001,7 @@ export default function StreamingInterface() {
|
|
999 |
}
|
1000 |
/>
|
1001 |
}
|
1002 |
-
label="Echo
|
1003 |
/>
|
1004 |
<FormControlLabel
|
1005 |
control={
|
@@ -1010,7 +1012,7 @@ export default function StreamingInterface() {
|
|
1010 |
) => setServerDebugFlag(event.target.checked)}
|
1011 |
/>
|
1012 |
}
|
1013 |
-
label="
|
1014 |
/>
|
1015 |
</FormControl>
|
1016 |
</Box>
|
@@ -1038,9 +1040,10 @@ export default function StreamingInterface() {
|
|
1038 |
</div>
|
1039 |
)}
|
1040 |
|
1041 |
-
<Stack direction="row" spacing={
|
1042 |
{streamingStatus === 'stopped' ? (
|
1043 |
<Button
|
|
|
1044 |
variant="contained"
|
1045 |
onClick={startStreaming}
|
1046 |
disabled={
|
@@ -1185,7 +1188,7 @@ export default function StreamingInterface() {
|
|
1185 |
</Stack>
|
1186 |
</div> */}
|
1187 |
</div>
|
1188 |
-
</
|
1189 |
</div>
|
1190 |
);
|
1191 |
}
|
|
|
98 |
}
|
99 |
|
100 |
const buttonLabelMap: {[key in StreamingStatus]: string} = {
|
101 |
+
stopped: 'Start broadcasting',
|
102 |
+
running: 'Stop broadcasting',
|
103 |
starting: 'Starting...',
|
104 |
};
|
105 |
|
|
|
734 |
|
735 |
return (
|
736 |
<div className="app-wrapper-sra">
|
737 |
+
<div
|
738 |
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
739 |
// @ts-ignore Not sure why it's complaining about complexity here
|
740 |
+
style={{width:"100%"}}
|
741 |
+
>
|
742 |
<div className="main-container-sra">
|
743 |
<Stack direction={{ xs: 'column', md: 'row' }} spacing={6} className="top-section-sra horizontal-padding-sra">
|
744 |
+
<Stack alignItems="center" sx={{ flex: 1, borderRight: { md: 1 } }}>
|
745 |
<div className="header-container-sra">
|
746 |
<img
|
747 |
src={"./logo.png"}
|
|
|
751 |
/>
|
752 |
|
753 |
<div>
|
754 |
+
<Typography variant="h1" fontSize={20} >
|
755 |
Hotdub Real Time Translation
|
756 |
</Typography>
|
757 |
</div>
|
758 |
</div>
|
759 |
|
760 |
+
{/* <Box> */}
|
761 |
<RoomConfig
|
762 |
roomState={roomState}
|
763 |
serverState={serverState}
|
|
|
782 |
{volumeSliderNode}
|
783 |
</Box>
|
784 |
)}
|
785 |
+
{/* </Box> */}
|
786 |
</Stack>
|
787 |
|
788 |
<Stack spacing="22px" direction="column" sx={{flex:1}}>
|
789 |
{!isSpeaker && (
|
790 |
<>
|
791 |
+
<Stack spacing={0.5}>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
<FormLabel id="output-modes-radio-group-label">
|
793 |
Output
|
794 |
</FormLabel>
|
|
|
796 |
<Box sx={{paddingTop: 2, paddingBottom: 1}}>
|
797 |
<FormControl fullWidth sx={{minWidth: '14em'}}>
|
798 |
<InputLabel id="target-selector-input-label">
|
799 |
+
Language
|
800 |
</InputLabel>
|
801 |
<Select
|
802 |
labelId="target-selector-input-label"
|
|
|
894 |
</Grid>
|
895 |
</Stack>
|
896 |
|
897 |
+
<Stack spacing="12px" direction="column">
|
898 |
+
<FormLabel id="output-modes-radio-group-label">
|
899 |
+
Model
|
900 |
+
</FormLabel>
|
901 |
+
<FormControl
|
902 |
+
disabled={
|
903 |
+
streamFixedConfigOptionsDisabled ||
|
904 |
+
agentsCapabilities.length === 0
|
905 |
+
}
|
906 |
+
fullWidth
|
907 |
+
sx={{minWidth: '14em'}}>
|
908 |
+
<InputLabel id="model-selector-input-label">
|
909 |
+
Model
|
910 |
+
</InputLabel>
|
911 |
+
<Select
|
912 |
+
labelId="model-selector-input-label"
|
913 |
+
label="Model"
|
914 |
+
onChange={(e: SelectChangeEvent) => {
|
915 |
+
const newAgent =
|
916 |
+
agentsCapabilities.find(
|
917 |
+
(agent) => e.target.value === agent.name,
|
918 |
+
) ?? null;
|
919 |
+
if (newAgent == null) {
|
920 |
+
console.error(
|
921 |
+
'Unable to find agent with name',
|
922 |
+
e.target.value,
|
923 |
+
);
|
924 |
+
}
|
925 |
+
setAgentAndUpdateParams(newAgent);
|
926 |
+
}}
|
927 |
+
value={model ?? ''}>
|
928 |
+
{agentsCapabilities.map((agent) => (
|
929 |
+
<MenuItem value={agent.name} key={agent.name}>
|
930 |
+
Hotdub Real Time Translation
|
931 |
+
</MenuItem>
|
932 |
+
))}
|
933 |
+
</Select>
|
934 |
+
</FormControl>
|
935 |
+
|
936 |
+
</Stack>
|
937 |
+
|
938 |
+
|
939 |
<Stack
|
940 |
direction="row"
|
941 |
+
// spacing={2}
|
942 |
+
justifyContent="space-between" >
|
943 |
+
<Box >
|
944 |
<FormControl disabled={streamFixedConfigOptionsDisabled}>
|
945 |
<FormLabel id="input-source-radio-group-label">
|
946 |
+
Audio Input
|
947 |
</FormLabel>
|
948 |
<RadioGroup
|
949 |
aria-labelledby="input-source-radio-group-label"
|
|
|
966 |
</FormControl>
|
967 |
</Box>
|
968 |
|
969 |
+
<Box >
|
970 |
<FormControl disabled={streamFixedConfigOptionsDisabled}>
|
971 |
<FormLabel>Options</FormLabel>
|
972 |
<FormControlLabel
|
|
|
984 |
}
|
985 |
/>
|
986 |
}
|
987 |
+
label="Noise Reduction"
|
988 |
/>
|
989 |
<FormControlLabel
|
990 |
control={
|
|
|
1001 |
}
|
1002 |
/>
|
1003 |
}
|
1004 |
+
label="Echo Reduction"
|
1005 |
/>
|
1006 |
<FormControlLabel
|
1007 |
control={
|
|
|
1012 |
) => setServerDebugFlag(event.target.checked)}
|
1013 |
/>
|
1014 |
}
|
1015 |
+
label="Debug Mode"
|
1016 |
/>
|
1017 |
</FormControl>
|
1018 |
</Box>
|
|
|
1040 |
</div>
|
1041 |
)}
|
1042 |
|
1043 |
+
<Stack direction="row" spacing={6} justifyContent="center">
|
1044 |
{streamingStatus === 'stopped' ? (
|
1045 |
<Button
|
1046 |
+
sx={{borderRadius: "20px"}}
|
1047 |
variant="contained"
|
1048 |
onClick={startStreaming}
|
1049 |
disabled={
|
|
|
1188 |
</Stack>
|
1189 |
</div> */}
|
1190 |
</div>
|
1191 |
+
</div>
|
1192 |
</div>
|
1193 |
);
|
1194 |
}
|
streaming-react-app/src/theme.ts
CHANGED
@@ -21,7 +21,6 @@ const themeObject = {
|
|
21 |
// text: {primary: '#1C2A33'},
|
22 |
// },
|
23 |
palette: {
|
24 |
-
background: {default: '#000033'},
|
25 |
primary: {
|
26 |
main: '#1976d2',
|
27 |
},
|
|
|
21 |
// text: {primary: '#1C2A33'},
|
22 |
// },
|
23 |
palette: {
|
|
|
24 |
primary: {
|
25 |
main: '#1976d2',
|
26 |
},
|
streaming-react-app/src/types/StreamingTypes.ts
CHANGED
@@ -54,7 +54,7 @@ export const SUPPORTED_INPUT_SOURCES: Array<{
|
|
54 |
label: string;
|
55 |
}> = [
|
56 |
{value: 'userMedia', label: 'Microphone'},
|
57 |
-
{value: 'displayMedia', label: 'Browser Tab
|
58 |
];
|
59 |
|
60 |
export type StartStreamEventConfig = {
|
|
|
54 |
label: string;
|
55 |
}> = [
|
56 |
{value: 'userMedia', label: 'Microphone'},
|
57 |
+
{value: 'displayMedia', label: 'Browser Tab'},
|
58 |
];
|
59 |
|
60 |
export type StartStreamEventConfig = {
|