Mood data to attach to transcription entries.
Used with enrichTranscription() to attach real-time mood analysis results to recent transcription entries. This enables displaying sentiment indicators alongside transcribed speech.
enrichTranscription()
Connecting MoodAnalysisProvider to transcriptions:
function App() { const { enrichTranscription } = useTranscription(); const handleMoodChange = (userId: string, moodState: MoodState) => { // Convert emotion to sentiment const sentiment = moodState.emotion === 'happy' ? 'positive' : ['sad', 'angry', 'fearful'].includes(moodState.emotion) ? 'negative' : 'neutral'; enrichTranscription(userId, { sentiment, emotion: moodState.emotion, engagement: moodState.engagement, confidence: moodState.confidence, }); }; return ( <MoodAnalysisProvider onMoodChange={handleMoodChange}> <VideoRoom /> </MoodAnalysisProvider> );} Copy
function App() { const { enrichTranscription } = useTranscription(); const handleMoodChange = (userId: string, moodState: MoodState) => { // Convert emotion to sentiment const sentiment = moodState.emotion === 'happy' ? 'positive' : ['sad', 'angry', 'fearful'].includes(moodState.emotion) ? 'negative' : 'neutral'; enrichTranscription(userId, { sentiment, emotion: moodState.emotion, engagement: moodState.engagement, confidence: moodState.confidence, }); }; return ( <MoodAnalysisProvider onMoodChange={handleMoodChange}> <VideoRoom /> </MoodAnalysisProvider> );}
Optional
Confidence of the mood detection (0-1)
Emotion string (e.g., 'happy', 'sad', 'neutral')
Engagement level (0-1)
Sentiment classification
Mood data to attach to transcription entries.
Remarks
Used with
enrichTranscription()to attach real-time mood analysis results to recent transcription entries. This enables displaying sentiment indicators alongside transcribed speech.Example
Connecting MoodAnalysisProvider to transcriptions:
See