feat: implement local audio streaming with controls in voice components

This commit is contained in:
MythEclipse
2026-05-16 21:08:39 +07:00
parent 82025a19b2
commit 62d131cf14
5 changed files with 95 additions and 5 deletions
@@ -15,7 +15,9 @@ interface VoiceControlProps {
onJoin: () => void;
onDisconnect: () => void;
onListenToggle: () => void;
onStreamingToggle: () => void;
isListening: boolean;
isStreaming: boolean;
}
export function VoiceControl({
@@ -30,7 +32,9 @@ export function VoiceControl({
onJoin,
onDisconnect,
onListenToggle,
onStreamingToggle,
isListening,
isStreaming,
}: VoiceControlProps) {
return (
<Card>
@@ -69,6 +73,9 @@ export function VoiceControl({
<Button variant={isListening ? "secondary" : "outline"} onClick={onListenToggle}>
{isListening ? "Stop Listening" : "Listen Live"}
</Button>
<Button variant={isStreaming ? "destructive" : "default"} onClick={onStreamingToggle}>
{isStreaming ? "Stop Transmitting" : "Start Transmitting"}
</Button>
</div>
</CardContent>
</Card>
@@ -14,11 +14,13 @@ interface VoicePanelProps {
activeSpeakers: ActiveSpeaker[];
levels: number[];
isListening: boolean;
isStreaming: boolean;
onGuildChange: (guildId: string) => void;
onChannelChange: (channelId: string) => void;
onJoin: () => void;
onDisconnect: () => void;
onListenToggle: () => void;
onStreamingToggle: () => void;
}
export function VoicePanel(props: VoicePanelProps) {