addd HPG state

This commit is contained in:
PxlLoewe
2025-05-21 14:48:07 -07:00
parent f52f870eed
commit 64ce254239
8 changed files with 165 additions and 28 deletions

View File

@@ -21,6 +21,8 @@ import { ROOMS } from "_data/livekitRooms";
export const Audio = () => {
const connection = usePilotConnectionStore();
const [showSource, setShowSource] = useState(false);
const {
isTalking,
toggleTalking,
@@ -31,9 +33,16 @@ export const Audio = () => {
remoteParticipants,
room,
message,
source,
} = useAudioStore();
const [selectedRoom, setSelectedRoom] = useState<string>("LST_01");
useEffect(() => {
setShowSource(true);
setTimeout(() => {
setShowSource(false);
}, 2000);
}, [source, isTalking]);
useEffect(() => {
const joinRoom = async () => {
if (connection.status != "connected") return;
@@ -55,6 +64,9 @@ export const Audio = () => {
{state === "error" && (
<div className="h-4 flex items-center">{message}</div>
)}
{showSource && source && (
<div className="h-4 flex items-center">{source}</div>
)}
<button
onClick={() => {
if (state === "connected") toggleTalking();