Mark Duppenthaler commited on
Commit
a29f052
1 Parent(s): 5aff120
streaming-react-app/src/StreamingInterface.tsx CHANGED
@@ -152,7 +152,6 @@ export default function StreamingInterface() {
152
  useState<StreamingStatus>('stopped');
153
 
154
  const isStreamConfiguredRef = useRef<boolean>(false);
155
-
156
  const [hasMaxSpeakers, setHasMaxSpeakers] = useState<boolean>(false);
157
 
158
  const [outputMode, setOutputMode] = useState<SupportedOutputMode>('s2s&t');
@@ -167,6 +166,9 @@ export default function StreamingInterface() {
167
 
168
  // Dynamic Params:
169
  const [targetLang, setTargetLang] = useState<string | null>(null);
 
 
 
170
 
171
  const [serverDebugFlag, setServerDebugFlag] = useState<boolean>(
172
  debugParam ?? false,
@@ -248,6 +250,7 @@ export default function StreamingInterface() {
248
  setAgent((prevAgent) => {
249
  if (prevAgent?.name !== newAgent?.name) {
250
  setTargetLang(newAgent?.targetLangs[0] ?? null);
 
251
  }
252
  return newAgent;
253
  });
@@ -424,6 +427,7 @@ export default function StreamingInterface() {
424
  // available before actually configuring and starting the stream
425
  const fullDynamicConfig: DynamicConfig = {
426
  targetLanguage: targetLang,
 
427
  };
428
 
429
  await onSetDynamicConfig(fullDynamicConfig);
@@ -753,7 +757,7 @@ export default function StreamingInterface() {
753
  <div className="header-container-sra">
754
  <div>
755
  <Typography variant="body2" sx={{color: '#65676B'}}>
756
- Welcome! This space is locked to one speaker at a time, please duplicate the space <a target="_blank" rel="noopener noreferrer" href="https://huggingface.co/spaces/facebook/seamless-streaming?duplicate=true">here</a>. Unset the environment variable `LOCK_SERVER_COMPLETELY` and `ONE_USER_ONLY`.
757
  <br/>
758
  In your duplicated space, join a room as speaker or listener (or both), and share the
759
  room code to invite listeners.
@@ -909,6 +913,28 @@ export default function StreamingInterface() {
909
  spacing={1}
910
  alignItems="flex-start"
911
  sx={{flexGrow: 1}}>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
912
  {isListener && (
913
  <Box
914
  sx={{
@@ -1090,8 +1116,6 @@ export default function StreamingInterface() {
1090
  </Alert>
1091
  </div>
1092
  )}
1093
-
1094
-
1095
  {serverState != null && hasMaxSpeakers && (
1096
  <div>
1097
  <Alert severity="error">
 
152
  useState<StreamingStatus>('stopped');
153
 
154
  const isStreamConfiguredRef = useRef<boolean>(false);
 
155
  const [hasMaxSpeakers, setHasMaxSpeakers] = useState<boolean>(false);
156
 
157
  const [outputMode, setOutputMode] = useState<SupportedOutputMode>('s2s&t');
 
166
 
167
  // Dynamic Params:
168
  const [targetLang, setTargetLang] = useState<string | null>(null);
169
+ const [enableExpressive, setEnableExpressive] = useState<boolean | null>(
170
+ null,
171
+ );
172
 
173
  const [serverDebugFlag, setServerDebugFlag] = useState<boolean>(
174
  debugParam ?? false,
 
250
  setAgent((prevAgent) => {
251
  if (prevAgent?.name !== newAgent?.name) {
252
  setTargetLang(newAgent?.targetLangs[0] ?? null);
253
+ setEnableExpressive(null);
254
  }
255
  return newAgent;
256
  });
 
427
  // available before actually configuring and starting the stream
428
  const fullDynamicConfig: DynamicConfig = {
429
  targetLanguage: targetLang,
430
+ expressive: enableExpressive,
431
  };
432
 
433
  await onSetDynamicConfig(fullDynamicConfig);
 
757
  <div className="header-container-sra">
758
  <div>
759
  <Typography variant="body2" sx={{color: '#65676B'}}>
760
+ Welcome! This space is locked to one speaker at a time, please duplicate the space <a target="_blank" rel="noopener noreferrer" href="https://huggingface.co/spaces/facebook/seamless-streaming?duplicate=true">here</a>. Unset the environment variable `LOCK_SERVER_COMPLETELY`.
761
  <br/>
762
  In your duplicated space, join a room as speaker or listener (or both), and share the
763
  room code to invite listeners.
 
913
  spacing={1}
914
  alignItems="flex-start"
915
  sx={{flexGrow: 1}}>
916
+ {currentAgent?.dynamicParams?.includes(
917
+ 'expressive',
918
+ ) && (
919
+ <FormControlLabel
920
+ control={
921
+ <Switch
922
+ checked={enableExpressive ?? false}
923
+ onChange={(
924
+ event: React.ChangeEvent<HTMLInputElement>,
925
+ ) => {
926
+ const newValue = event.target.checked;
927
+ setEnableExpressive(newValue);
928
+ onSetDynamicConfig({
929
+ expressive: newValue,
930
+ });
931
+ }}
932
+ />
933
+ }
934
+ label="Expressive"
935
+ />
936
+ )}
937
+
938
  {isListener && (
939
  <Box
940
  sx={{
 
1116
  </Alert>
1117
  </div>
1118
  )}
 
 
1119
  {serverState != null && hasMaxSpeakers && (
1120
  <div>
1121
  <Alert severity="error">