Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions smnb/app/dashboard/studio/host/Host.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import React, { useEffect } from "react";
import { WaterfallNarration } from "@/components/host/WaterfallNarration";
import { useHostAgentStore } from "@/lib/stores/host/hostAgentStore";
import { Settings } from 'lucide-react';
import { Settings, Mic, MicOff } from 'lucide-react';

export default function Host() {
const {
Expand All @@ -25,8 +25,10 @@ export default function Host() {
nextStoryCountdown,
isGenerating,
stats,
isMicActive,
initializeHostAgent,
cleanup
cleanup,
toggleMic
} = useHostAgentStore();

// Initialize host agent on mount
Expand Down Expand Up @@ -75,6 +77,13 @@ export default function Host() {
>
<Settings className="w-3 h-3" />
</button>
<button
title={isMicActive ? "Disable Audio Narration" : "Enable Audio Narration"}
onClick={toggleMic}
className="p-1 hover:bg-[#2d2d2d] rounded transition-colors border text-muted-foreground cursor-pointer"
>
{isMicActive ? <Mic className="w-3 h-3" /> : <MicOff className="w-3 h-3" />}
</button>
</div>
</div>

Expand Down
18 changes: 18 additions & 0 deletions smnb/lib/stores/host/hostAgentStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ interface HostAgentState {
isActive: boolean;
currentNarration: HostNarration | null;

// Audio control state
isMicActive: boolean;

// Streaming state
isStreaming: boolean;
streamingText: string;
Expand Down Expand Up @@ -120,6 +123,9 @@ interface HostAgentState {
processRedditPost: (post: EnhancedRedditPost) => Promise<void>;
processLiveFeedPost: (post: EnhancedRedditPost) => void;

// Audio control actions
toggleMic: () => void;

// Streaming actions
addToQueue: () => void;
processNextInQueue: () => void;
Expand All @@ -145,6 +151,9 @@ export const useHostAgentStore = create<HostAgentState>((set, get) => ({
isActive: false,
currentNarration: null,

// Audio control state
isMicActive: false,

// Streaming state
isStreaming: false,
streamingText: '',
Expand Down Expand Up @@ -543,5 +552,14 @@ export const useHostAgentStore = create<HostAgentState>((set, get) => ({
}));

console.log('✅ Complete host agent state reset completed');
},

// Toggle mic active state
toggleMic: () => {
set((state) => {
const newMicState = !state.isMicActive;
console.log(`🎤 HOST: Mic ${newMicState ? 'activated' : 'deactivated'}`);
return { isMicActive: newMicState };
});
}
}));