Undiverge main branch from projector branch

This commit is contained in:
Koper
2023-10-12 14:12:34 +01:00
parent 35af25d4e8
commit 4e80e1cdb3
8 changed files with 395 additions and 2 deletions

View File

@@ -9,3 +9,18 @@ export const formatTime = (seconds: number): string => {
return timeString;
};
export const formatTimeDifference = (seconds: number): string => {
let hours = Math.floor(seconds / 3600);
let minutes = Math.floor((seconds % 3600) / 60);
let secs = Math.floor(seconds % 60);
let timeString =
hours > 0
? `${hours < 10 ? "\u00A0" : ""}${hours}h ago`
: minutes > 0
? `${minutes < 10 ? "\u00A0" : ""}${minutes}m ago`
: `<1m ago`;
return timeString;
};

3
www/app/lib/utils.ts Normal file
View File

@@ -0,0 +1,3 @@
export function isDevelopment() {
return process.env.NEXT_PUBLIC_ENV === "development";
}

View File

@@ -78,11 +78,23 @@ const useAudioDevice = () => {
deviceId: string,
): Promise<MediaStream | null> => {
try {
const urlParams = new URLSearchParams(window.location.search);
const noiseSuppression = urlParams.get("noiseSuppression") === "true";
const echoCancellation = urlParams.get("echoCancellation") === "true";
console.debug(
"noiseSuppression",
noiseSuppression,
"echoCancellation",
echoCancellation,
);
const stream = await navigator.mediaDevices.getUserMedia({
audio: {
deviceId,
noiseSuppression: false,
echoCancellation: false,
noiseSuppression,
echoCancellation,
},
});
return stream;

View File

@@ -17,3 +17,8 @@ export type FinalSummary = {
export type Status = {
value: string;
};
export type TranslatedTopic = {
text: string;
translation: string;
};