@convai/web-sdk 0.2.2 → 0.2.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/ConvaiClient.d.ts +3 -0
- package/dist/core/ConvaiClient.d.ts.map +1 -1
- package/dist/core/ConvaiClient.js +18 -1
- package/dist/core/ConvaiClient.js.map +1 -1
- package/dist/core/MessageHandler.d.ts +7 -1
- package/dist/core/MessageHandler.d.ts.map +1 -1
- package/dist/core/MessageHandler.js +15 -1
- package/dist/core/MessageHandler.js.map +1 -1
- package/dist/core/types.d.ts +3 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/dev.d.ts +12 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +12 -0
- package/dist/dev.js.map +1 -0
- package/dist/react/components/ConvaiWidget.d.ts.map +1 -1
- package/dist/react/components/ConvaiWidget.js +34 -3
- package/dist/react/components/ConvaiWidget.js.map +1 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +36 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js +259 -0
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js.map +1 -0
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +5 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +156 -100
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +1 -1
- package/dist/react/components/rtc-widget/components/index.d.ts +1 -0
- package/dist/react/components/rtc-widget/components/index.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/index.js +2 -0
- package/dist/react/components/rtc-widget/components/index.js.map +1 -1
- package/dist/react/hooks/useConvaiClient.d.ts.map +1 -1
- package/dist/react/hooks/useConvaiClient.js +1 -0
- package/dist/react/hooks/useConvaiClient.js.map +1 -1
- package/dist/utils/LatencyMonitor.d.ts +88 -0
- package/dist/utils/LatencyMonitor.d.ts.map +1 -0
- package/dist/utils/LatencyMonitor.js +136 -0
- package/dist/utils/LatencyMonitor.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
const VisualizerContainer = styled.div `
|
|
5
|
+
position: absolute;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
z-index: 1;
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
overflow: visible;
|
|
12
|
+
`;
|
|
13
|
+
const Canvas = styled.canvas `
|
|
14
|
+
display: block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
`;
|
|
18
|
+
/**
|
|
19
|
+
* Circular Audio Visualizer Component
|
|
20
|
+
*
|
|
21
|
+
* A real-time circular audio visualization component that displays radial bars arranged
|
|
22
|
+
* in a circle around an avatar. The visualization reacts to the remote participant's
|
|
23
|
+
* (bot) audio output from a LiveKit room, using logarithmic frequency bands and a
|
|
24
|
+
* traveling wave animation effect.
|
|
25
|
+
*
|
|
26
|
+
* Features:
|
|
27
|
+
* - Circular radial bar visualization with configurable bar count
|
|
28
|
+
* - Logarithmic frequency band distribution (low frequencies distributed around the ring)
|
|
29
|
+
* - Traveling wave animation that propagates around the circle
|
|
30
|
+
* - Speaking detection with callback support
|
|
31
|
+
* - Automatic track detection and reconnection
|
|
32
|
+
* - Canvas-based rendering for smooth animations
|
|
33
|
+
*/
|
|
34
|
+
export const AudioVisualizer = ({ room, size = 350, color = '#10b981', opacity = 0.4, avatarRadius = 80, barCount = 64, onSpeakingChange, }) => {
|
|
35
|
+
// Refs for canvas and Web Audio API nodes
|
|
36
|
+
const canvasRef = useRef(null);
|
|
37
|
+
const animationFrameRef = useRef(null);
|
|
38
|
+
const audioContextRef = useRef(null);
|
|
39
|
+
const analyserRef = useRef(null);
|
|
40
|
+
const sourceNodeRef = useRef(null);
|
|
41
|
+
const isActiveRef = useRef(false);
|
|
42
|
+
// Refs for animation and state management
|
|
43
|
+
const timeRef = useRef(0);
|
|
44
|
+
const previousSpeakingStateRef = useRef(false);
|
|
45
|
+
const bandEdgesRef = useRef(null);
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!room)
|
|
48
|
+
return;
|
|
49
|
+
const canvas = canvasRef.current;
|
|
50
|
+
if (!canvas)
|
|
51
|
+
return;
|
|
52
|
+
const ctx = canvas.getContext('2d');
|
|
53
|
+
if (!ctx)
|
|
54
|
+
return;
|
|
55
|
+
canvas.width = size;
|
|
56
|
+
canvas.height = size;
|
|
57
|
+
// Initialize Web Audio API context and analyser
|
|
58
|
+
const audioContext = new (window.AudioContext || window.webkitAudioContext)();
|
|
59
|
+
const analyser = audioContext.createAnalyser();
|
|
60
|
+
analyser.fftSize = 512;
|
|
61
|
+
analyser.smoothingTimeConstant = 0.6;
|
|
62
|
+
audioContextRef.current = audioContext;
|
|
63
|
+
analyserRef.current = analyser;
|
|
64
|
+
/**
|
|
65
|
+
* Builds logarithmically-spaced frequency band edges.
|
|
66
|
+
* This distributes low-frequency energy (which has more power) evenly around
|
|
67
|
+
* the circular visualization, rather than clustering it at the start.
|
|
68
|
+
*/
|
|
69
|
+
const buildLogBands = () => {
|
|
70
|
+
const nyquist = audioContext.sampleRate / 2;
|
|
71
|
+
const bufferLength = analyser.frequencyBinCount;
|
|
72
|
+
const minHz = 60;
|
|
73
|
+
const maxHz = Math.min(8000, nyquist);
|
|
74
|
+
const edges = Array.from({ length: barCount + 1 }, (_, k) => {
|
|
75
|
+
const hz = minHz * Math.pow(maxHz / minHz, k / barCount);
|
|
76
|
+
const bin = Math.max(0, Math.min(bufferLength - 1, Math.floor((hz / nyquist) * bufferLength)));
|
|
77
|
+
return bin;
|
|
78
|
+
});
|
|
79
|
+
// Ensure strictly increasing edges (no zero-width bands)
|
|
80
|
+
for (let i = 1; i < edges.length; i++) {
|
|
81
|
+
if (edges[i] <= edges[i - 1])
|
|
82
|
+
edges[i] = Math.min(edges[i - 1] + 1, bufferLength - 1);
|
|
83
|
+
}
|
|
84
|
+
bandEdgesRef.current = edges;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Finds the bot participant from remote participants.
|
|
88
|
+
*/
|
|
89
|
+
const findBotParticipant = (remoteParticipants, localParticipant) => {
|
|
90
|
+
const participants = Array.from(remoteParticipants.values()).filter((p) => p !== localParticipant && p !== room.localParticipant);
|
|
91
|
+
if (participants.length === 0) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
// Prefer participants with audio tracks (bot typically has audio)
|
|
95
|
+
const participantsWithAudio = participants.filter((participant) => {
|
|
96
|
+
if (!participant.trackPublications)
|
|
97
|
+
return false;
|
|
98
|
+
const audioTracks = Array.from(participant.trackPublications.values()).filter((p) => p.kind === 'audio' && p.track);
|
|
99
|
+
return audioTracks.length > 0;
|
|
100
|
+
});
|
|
101
|
+
return participantsWithAudio.length > 0 ? participantsWithAudio[0] : participants[0];
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Sets up the audio source by connecting the remote participant's (bot) audio track
|
|
105
|
+
* to the Web Audio API analyser.
|
|
106
|
+
*/
|
|
107
|
+
const setupAudioSource = async () => {
|
|
108
|
+
try {
|
|
109
|
+
if (audioContext.state === 'suspended')
|
|
110
|
+
await audioContext.resume();
|
|
111
|
+
const remoteParticipants = room.remoteParticipants;
|
|
112
|
+
if (remoteParticipants.size === 0) {
|
|
113
|
+
isActiveRef.current = false;
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const botParticipant = findBotParticipant(remoteParticipants, room.localParticipant);
|
|
117
|
+
if (!botParticipant) {
|
|
118
|
+
isActiveRef.current = false;
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const audioTracks = Array.from(botParticipant.trackPublications.values()).filter((p) => p.kind === 'audio' && p.track);
|
|
122
|
+
if (audioTracks.length === 0) {
|
|
123
|
+
isActiveRef.current = false;
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const liveKitTrack = audioTracks[0].track;
|
|
127
|
+
const mediaStreamTrack = liveKitTrack.mediaStreamTrack;
|
|
128
|
+
if (!mediaStreamTrack) {
|
|
129
|
+
isActiveRef.current = false;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const mediaStream = new MediaStream([mediaStreamTrack]);
|
|
133
|
+
if (sourceNodeRef.current)
|
|
134
|
+
sourceNodeRef.current.disconnect();
|
|
135
|
+
const source = audioContext.createMediaStreamSource(mediaStream);
|
|
136
|
+
source.connect(analyser);
|
|
137
|
+
sourceNodeRef.current = source;
|
|
138
|
+
// Build bands after context is ready
|
|
139
|
+
buildLogBands();
|
|
140
|
+
isActiveRef.current = true;
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
isActiveRef.current = false;
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
setupAudioSource();
|
|
147
|
+
const setupTimeout = setTimeout(setupAudioSource, 500);
|
|
148
|
+
const handleTrackSubscribed = (track, publication, participant) => {
|
|
149
|
+
if (track && track.kind === 'audio' && participant !== room.localParticipant) {
|
|
150
|
+
setTimeout(setupAudioSource, 200);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const handleParticipantConnected = (participant) => {
|
|
154
|
+
if (participant !== room.localParticipant)
|
|
155
|
+
setTimeout(setupAudioSource, 200);
|
|
156
|
+
};
|
|
157
|
+
room.on('trackSubscribed', handleTrackSubscribed);
|
|
158
|
+
room.on('participantConnected', handleParticipantConnected);
|
|
159
|
+
/**
|
|
160
|
+
* Main rendering function that draws the circular audio visualization.
|
|
161
|
+
*/
|
|
162
|
+
const bufferLength = analyser.frequencyBinCount;
|
|
163
|
+
const dataArray = new Uint8Array(bufferLength);
|
|
164
|
+
const draw = () => {
|
|
165
|
+
timeRef.current += 0.08;
|
|
166
|
+
analyser.getByteFrequencyData(dataArray);
|
|
167
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
168
|
+
const centerX = canvas.width / 2;
|
|
169
|
+
const centerY = canvas.height / 2;
|
|
170
|
+
// The bars should surround the character, not be clipped inside
|
|
171
|
+
// Character is 120px (radius 60px), visualizer canvas is 220px (radius 110px)
|
|
172
|
+
const characterRadius = 60; // Half of 120px character image
|
|
173
|
+
const innerRadius = characterRadius; // Start bars at edge of character
|
|
174
|
+
const outerRadius = avatarRadius; // Extend to edge of visualizer canvas
|
|
175
|
+
const maxBarLength = outerRadius - innerRadius;
|
|
176
|
+
ctx.save();
|
|
177
|
+
// No clipping - let bars render freely around the circle
|
|
178
|
+
const angleStep = (Math.PI * 2) / barCount;
|
|
179
|
+
// Calculate overall audio level for speaking detection
|
|
180
|
+
let total = 0;
|
|
181
|
+
for (let i = 0; i < bufferLength; i++)
|
|
182
|
+
total += isActiveRef.current ? (dataArray[i] || 0) : 0;
|
|
183
|
+
const overallLevel = total / (bufferLength * 255);
|
|
184
|
+
// Speaking detection
|
|
185
|
+
const speakingThreshold = 0.1;
|
|
186
|
+
const isSpeaking = isActiveRef.current && overallLevel > speakingThreshold;
|
|
187
|
+
if (onSpeakingChange && isSpeaking !== previousSpeakingStateRef.current) {
|
|
188
|
+
previousSpeakingStateRef.current = isSpeaking;
|
|
189
|
+
onSpeakingChange(isSpeaking);
|
|
190
|
+
}
|
|
191
|
+
// Precompute band edges if not ready yet
|
|
192
|
+
if (!bandEdgesRef.current) {
|
|
193
|
+
bandEdgesRef.current = Array.from({ length: barCount + 1 }, (_, k) => Math.floor((k / barCount) * bufferLength));
|
|
194
|
+
}
|
|
195
|
+
const edges = bandEdgesRef.current;
|
|
196
|
+
// Traveling wave parameters
|
|
197
|
+
const waveRevolutions = 2;
|
|
198
|
+
const phasePerBar = (Math.PI * 2 * waveRevolutions) / barCount;
|
|
199
|
+
const baseWaveAmp = 0.35;
|
|
200
|
+
const waveAmp = baseWaveAmp * (0.3 + 0.7 * overallLevel);
|
|
201
|
+
for (let i = 0; i < barCount; i++) {
|
|
202
|
+
const angle = i * angleStep - Math.PI / 2;
|
|
203
|
+
// Calculate average energy for this bar's frequency band
|
|
204
|
+
const startFreq = edges[i];
|
|
205
|
+
const endFreq = edges[i + 1];
|
|
206
|
+
let sum = 0;
|
|
207
|
+
let count = 0;
|
|
208
|
+
for (let f = startFreq; f < endFreq && f < bufferLength; f++) {
|
|
209
|
+
sum += isActiveRef.current ? (dataArray[f] || 0) : 0;
|
|
210
|
+
count++;
|
|
211
|
+
}
|
|
212
|
+
const bandAvg = count > 0 ? sum / (count * 255) : 0;
|
|
213
|
+
// Mix band-specific energy with overall level
|
|
214
|
+
const energy = 0.4 * bandAvg + 0.6 * overallLevel;
|
|
215
|
+
// Apply traveling wave modulation
|
|
216
|
+
const wavePhase = i * phasePerBar;
|
|
217
|
+
const wave = 1 + waveAmp * Math.sin(timeRef.current + wavePhase);
|
|
218
|
+
// Final intensity
|
|
219
|
+
const intensity = Math.min(1, energy * wave);
|
|
220
|
+
// Convert to bar length
|
|
221
|
+
const length = Math.max(maxBarLength * 0.03, intensity * maxBarLength * 0.95);
|
|
222
|
+
// Coordinates
|
|
223
|
+
const startX = centerX + Math.cos(angle) * innerRadius;
|
|
224
|
+
const startY = centerY + Math.sin(angle) * innerRadius;
|
|
225
|
+
const endX = centerX + Math.cos(angle) * (innerRadius + length);
|
|
226
|
+
const endY = centerY + Math.sin(angle) * (innerRadius + length);
|
|
227
|
+
// Draw
|
|
228
|
+
ctx.strokeStyle = color;
|
|
229
|
+
ctx.lineWidth = 5;
|
|
230
|
+
ctx.lineCap = 'round';
|
|
231
|
+
ctx.globalAlpha = opacity * (0.5 + 0.5 * intensity);
|
|
232
|
+
ctx.beginPath();
|
|
233
|
+
ctx.moveTo(startX, startY);
|
|
234
|
+
ctx.lineTo(endX, endY);
|
|
235
|
+
ctx.stroke();
|
|
236
|
+
}
|
|
237
|
+
ctx.globalAlpha = 1;
|
|
238
|
+
ctx.restore();
|
|
239
|
+
animationFrameRef.current = requestAnimationFrame(draw);
|
|
240
|
+
};
|
|
241
|
+
draw();
|
|
242
|
+
return () => {
|
|
243
|
+
clearTimeout(setupTimeout);
|
|
244
|
+
if (animationFrameRef.current)
|
|
245
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
246
|
+
if (sourceNodeRef.current)
|
|
247
|
+
sourceNodeRef.current.disconnect();
|
|
248
|
+
if (analyserRef.current)
|
|
249
|
+
analyserRef.current.disconnect();
|
|
250
|
+
if (audioContextRef.current && audioContextRef.current.state !== 'closed') {
|
|
251
|
+
audioContextRef.current.close();
|
|
252
|
+
}
|
|
253
|
+
room.off('trackSubscribed', handleTrackSubscribed);
|
|
254
|
+
room.off('participantConnected', handleParticipantConnected);
|
|
255
|
+
};
|
|
256
|
+
}, [room, size, color, opacity, avatarRadius, barCount, onSpeakingChange]);
|
|
257
|
+
return (_jsx(VisualizerContainer, { style: { width: size, height: size }, children: _jsx(Canvas, { ref: canvasRef }) }));
|
|
258
|
+
};
|
|
259
|
+
//# sourceMappingURL=AudioVisualizer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AudioVisualizer.js","sourceRoot":"","sources":["../../../../../src/react/components/rtc-widget/components/AudioVisualizer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAGvC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQrC,CAAC;AAEF,MAAM,MAAM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K,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC;IAE3E,OAAO,CACL,KAAC,mBAAmB,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YACvD,KAAC,MAAM,IAAC,GAAG,EAAE,SAAS,GAAI,GACN,CACvB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConviHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/react/components/rtc-widget/components/conviComponents/ConviHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,UAAU,gBAAgB;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,WAAW,GAAI,kKAYzB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"ConviHeader.d.ts","sourceRoot":"","sources":["../../../../../../src/react/components/rtc-widget/components/conviComponents/ConviHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,UAAU,gBAAgB;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,iBAAiB,EAAE,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,WAAW,GAAI,kKAYzB,gBAAgB,4CAwIlB,CAAC"}
|
|
@@ -13,7 +13,7 @@ export const ConviHeader = ({ isOpen, isSpeakerEditMode, isVoiceMode, isVerbosit
|
|
|
13
13
|
}, transition: {
|
|
14
14
|
delay: isOpen ? 0.4 : 0,
|
|
15
15
|
...iosTransitions.modalSlide,
|
|
16
|
-
}, children: [_jsx(CloseButton, { onClick: onClose, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, transition: iosTransitions.snappy, style: { cursor: "pointer" }, children: _jsx(ChevronDown, { size: "md" }) }), _jsxs(Title, { children: [characterImage && (_jsx(
|
|
16
|
+
}, children: [_jsx(CloseButton, { onClick: onClose, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, transition: iosTransitions.snappy, style: { cursor: "pointer" }, children: _jsx(ChevronDown, { size: "md" }) }), _jsxs(Title, { children: [characterImage && !isVoiceMode && (_jsx(motion.img, { layoutId: "character-avatar", src: characterImage, alt: characterName, transition: iosTransitions.fadePop, style: {
|
|
17
17
|
width: "1.5rem",
|
|
18
18
|
height: "1.5rem",
|
|
19
19
|
borderRadius: "50%",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConviHeader.js","sourceRoot":"","sources":["../../../../../../src/react/components/rtc-widget/components/conviComponents/ConviHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY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ader.js","sourceRoot":"","sources":["../../../../../../src/react/components/rtc-widget/components/conviComponents/ConviHeader.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EACL,MAAM,EACN,KAAK,EACL,WAAW,EACX,cAAc,GACf,MAAM,+BAA+B,CAAC;AAgBvC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,MAAM,EACN,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,OAAO,EACP,cAAc,EACd,aAAa,GAAG,WAAW,EAC3B,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,GACA,EAAE,EAAE;IACrB,OAAO,CACL,MAAC,MAAM,IACL,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAC/B,OAAO,EAAE;YACP,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACvB,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SACpB,EACD,UAAU,EAAE;YACV,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACvB,GAAG,cAAc,CAAC,UAAU;SAC7B,aAED,KAAC,WAAW,IACV,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAC1B,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EACx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,cAAc,IACb,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EAC1B,QAAQ,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,EACxB,UAAU,EAAE,cAAc,CAAC,MAAM,EACjC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAE5B,KAAC,cAAc,IAAC,IAAI,EAAE,EAAE,GAAI,GACb,GACb,IACC,CACV,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { Room } from "livekit-client";
|
|
1
2
|
interface VoiceModeOverlayProps {
|
|
2
3
|
isActive: boolean;
|
|
3
4
|
isTalking: boolean;
|
|
4
5
|
convaiClient?: any;
|
|
6
|
+
characterImage?: string;
|
|
7
|
+
characterName?: string;
|
|
8
|
+
room?: Room | null;
|
|
5
9
|
}
|
|
6
|
-
export declare const VoiceModeOverlay: ({ isActive, isTalking, convaiClient, }: VoiceModeOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const VoiceModeOverlay: ({ isActive, isTalking, convaiClient, characterImage, characterName, room, }: VoiceModeOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
export {};
|
|
8
12
|
//# sourceMappingURL=VoiceModeOverlay.d.ts.map
|
package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VoiceModeOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VoiceModeOverlay.d.ts","sourceRoot":"","sources":["../../../../../../src/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,6EAO9B,qBAAqB,4CA8YvB,CAAC"}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
import { motion } from "framer-motion";
|
|
3
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
4
4
|
import { aeroTheme } from "../../styles/theme";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { iosTransitions } from "../../styles/framerConfig";
|
|
6
|
+
import { AudioVisualizer } from "../AudioVisualizer";
|
|
7
|
+
export const VoiceModeOverlay = ({ isActive, isTalking, convaiClient, characterImage, characterName = "Character", room, }) => {
|
|
8
|
+
const barsCount = 40; // Number of bars for user microphone waveform
|
|
8
9
|
const [audioLevels, setAudioLevels] = useState(Array(barsCount).fill(0));
|
|
9
10
|
const analyzerRef = useRef(null);
|
|
10
11
|
const animationFrameRef = useRef(undefined);
|
|
11
12
|
const audioContextRef = useRef(null);
|
|
12
|
-
|
|
13
|
-
const characterAnalyzerRef = useRef(null);
|
|
14
|
-
const mediaSourceNodeRef = useRef(null);
|
|
15
|
-
// Setup audio analysis for microphone input
|
|
13
|
+
// Setup audio analysis for USER microphone input ONLY
|
|
16
14
|
useEffect(() => {
|
|
17
15
|
if (!isActive) {
|
|
18
|
-
// Clean up when not
|
|
16
|
+
// Clean up when user is not speaking
|
|
19
17
|
if (animationFrameRef.current) {
|
|
20
18
|
cancelAnimationFrame(animationFrameRef.current);
|
|
21
19
|
}
|
|
@@ -84,62 +82,7 @@ export const VoiceModeOverlay = ({ isActive, isTalking, convaiClient, }) => {
|
|
|
84
82
|
}
|
|
85
83
|
};
|
|
86
84
|
}, [isActive, barsCount]);
|
|
87
|
-
|
|
88
|
-
useEffect(() => {
|
|
89
|
-
if (!isTalking) {
|
|
90
|
-
if (!isActive) {
|
|
91
|
-
setAudioLevels(Array(barsCount).fill(0));
|
|
92
|
-
}
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
// Start low and build up naturally like real speech
|
|
96
|
-
let startTime = Date.now();
|
|
97
|
-
let currentLevels = Array(barsCount).fill(0.05); // Start very low
|
|
98
|
-
let targetLevels = Array(barsCount).fill(0.05);
|
|
99
|
-
const updateLevels = () => {
|
|
100
|
-
if (!isTalking)
|
|
101
|
-
return;
|
|
102
|
-
const elapsed = (Date.now() - startTime) / 1000; // seconds
|
|
103
|
-
// Generate new random target levels occasionally (simulating syllables/words)
|
|
104
|
-
if (Math.random() < 0.08) {
|
|
105
|
-
// 8% chance per frame = ~5 times per second
|
|
106
|
-
targetLevels = Array(barsCount)
|
|
107
|
-
.fill(0)
|
|
108
|
-
.map((_, i) => {
|
|
109
|
-
// More variation in the middle bars, less on edges for natural spread
|
|
110
|
-
const position = i / barsCount;
|
|
111
|
-
const centerWeight = 1 - Math.abs(position - 0.5) * 0.5;
|
|
112
|
-
// Random peaks and valleys like speech patterns
|
|
113
|
-
const randomPeak = 0.2 + Math.random() * 0.7; // 0.2 to 0.9
|
|
114
|
-
// Add some neighbor correlation so bars don't jump independently
|
|
115
|
-
const prevTarget = targetLevels[i] || 0.3;
|
|
116
|
-
const correlation = prevTarget * 0.4 + randomPeak * 0.6;
|
|
117
|
-
return correlation * centerWeight;
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
// Smoothly interpolate current levels toward targets (organic movement)
|
|
121
|
-
currentLevels = currentLevels.map((current, i) => {
|
|
122
|
-
const target = targetLevels[i];
|
|
123
|
-
const speed = 0.2; // Smooth but responsive
|
|
124
|
-
return current + (target - current) * speed;
|
|
125
|
-
});
|
|
126
|
-
// Apply a gentle fade-in for the first 0.3 seconds
|
|
127
|
-
const fadeIn = Math.min(1, elapsed / 0.3);
|
|
128
|
-
const levels = currentLevels.map((level) => {
|
|
129
|
-
// Small random jitter for micro-variation
|
|
130
|
-
const microJitter = 0.95 + Math.random() * 0.1; // 0.95 to 1.05
|
|
131
|
-
return Math.max(0.05, Math.min(1, level * fadeIn * microJitter));
|
|
132
|
-
});
|
|
133
|
-
setAudioLevels(levels);
|
|
134
|
-
animationFrameRef.current = requestAnimationFrame(updateLevels);
|
|
135
|
-
};
|
|
136
|
-
updateLevels();
|
|
137
|
-
return () => {
|
|
138
|
-
if (animationFrameRef.current) {
|
|
139
|
-
cancelAnimationFrame(animationFrameRef.current);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
}, [isTalking, isActive, barsCount]);
|
|
85
|
+
const [isBotSpeaking, setIsBotSpeaking] = useState(false);
|
|
143
86
|
return (_jsxs("div", { style: {
|
|
144
87
|
position: "absolute",
|
|
145
88
|
top: "50%",
|
|
@@ -148,52 +91,165 @@ export const VoiceModeOverlay = ({ isActive, isTalking, convaiClient, }) => {
|
|
|
148
91
|
textAlign: "center",
|
|
149
92
|
padding: "1rem",
|
|
150
93
|
zIndex: 10,
|
|
151
|
-
pointerEvents: "
|
|
94
|
+
pointerEvents: "none",
|
|
152
95
|
display: "flex",
|
|
153
96
|
flexDirection: "column",
|
|
154
97
|
alignItems: "center",
|
|
155
|
-
gap: "
|
|
156
|
-
}, children: [
|
|
98
|
+
gap: "2rem",
|
|
99
|
+
}, children: [_jsxs("div", { style: {
|
|
100
|
+
position: "relative",
|
|
157
101
|
display: "flex",
|
|
158
102
|
alignItems: "center",
|
|
159
103
|
justifyContent: "center",
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}, transition: {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
:
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
104
|
+
isolation: "isolate", // Create stacking context
|
|
105
|
+
}, children: [room && (_jsx(motion.div, { initial: { opacity: 0, scale: 0.8 }, animate: {
|
|
106
|
+
opacity: isBotSpeaking ? 1 : 0,
|
|
107
|
+
scale: isBotSpeaking ? 1 : 0.8,
|
|
108
|
+
}, transition: iosTransitions.fadePop, style: {
|
|
109
|
+
position: "absolute",
|
|
110
|
+
width: "220px",
|
|
111
|
+
height: "220px",
|
|
112
|
+
zIndex: -1, // Negative z-index to ensure it's behind
|
|
113
|
+
pointerEvents: "none",
|
|
114
|
+
}, children: _jsx(AudioVisualizer, { room: room, size: 220, color: aeroTheme.colors.convai.light, opacity: 0.6, avatarRadius: 110, barCount: 48, onSpeakingChange: setIsBotSpeaking }) })), _jsxs(motion.div, { initial: { scale: 0.8, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.8, opacity: 0 }, transition: iosTransitions.fadePop, style: {
|
|
115
|
+
position: "relative",
|
|
116
|
+
zIndex: 10, // Higher z-index to be clearly on top
|
|
117
|
+
borderRadius: "50%",
|
|
118
|
+
overflow: "visible", // Changed to visible to show glow
|
|
119
|
+
boxShadow: "0 8px 32px rgba(0, 0, 0, 0.3)",
|
|
120
|
+
background: "white",
|
|
121
|
+
}, children: [_jsx(motion.div, { animate: {
|
|
122
|
+
rotate: [0, 360],
|
|
123
|
+
scale: isBotSpeaking ? [1, 1.05, 1.02, 1.05, 1] : 1,
|
|
124
|
+
}, transition: {
|
|
125
|
+
rotate: { duration: 20, repeat: Infinity, ease: "linear" },
|
|
126
|
+
scale: { duration: 3, repeat: Infinity, ease: "easeInOut" },
|
|
127
|
+
}, style: {
|
|
128
|
+
position: "absolute",
|
|
129
|
+
width: "126px",
|
|
130
|
+
height: "126px",
|
|
131
|
+
borderRadius: "50%",
|
|
132
|
+
background: `
|
|
133
|
+
conic-gradient(
|
|
134
|
+
from 0deg,
|
|
135
|
+
${aeroTheme.colors.convai.light}00 0%,
|
|
136
|
+
${aeroTheme.colors.convai.light}40 25%,
|
|
137
|
+
${aeroTheme.colors.convai.dark}60 50%,
|
|
138
|
+
${aeroTheme.colors.convai.light}40 75%,
|
|
139
|
+
${aeroTheme.colors.convai.light}00 100%
|
|
140
|
+
)
|
|
141
|
+
`,
|
|
142
|
+
opacity: 0.8,
|
|
143
|
+
filter: "blur(8px)",
|
|
144
|
+
zIndex: -2,
|
|
145
|
+
} }), _jsx(motion.div, { animate: {
|
|
146
|
+
rotate: [360, 0],
|
|
147
|
+
scale: isBotSpeaking ? [1, 1.03, 1.06, 1.03, 1] : 1,
|
|
148
|
+
}, transition: {
|
|
149
|
+
rotate: { duration: 15, repeat: Infinity, ease: "linear" },
|
|
150
|
+
scale: { duration: 2.5, repeat: Infinity, ease: "easeInOut" },
|
|
151
|
+
}, style: {
|
|
152
|
+
position: "absolute",
|
|
153
|
+
width: "126px",
|
|
154
|
+
height: "126px",
|
|
155
|
+
borderRadius: "50%",
|
|
156
|
+
background: `
|
|
157
|
+
radial-gradient(
|
|
158
|
+
ellipse 80% 100% at 30% 40%,
|
|
159
|
+
${aeroTheme.colors.convai.light}50,
|
|
160
|
+
${aeroTheme.colors.convai.light}30 40%,
|
|
161
|
+
transparent 70%
|
|
162
|
+
),
|
|
163
|
+
radial-gradient(
|
|
164
|
+
ellipse 80% 100% at 70% 60%,
|
|
165
|
+
${aeroTheme.colors.convai.dark}50,
|
|
166
|
+
${aeroTheme.colors.convai.dark}30 40%,
|
|
167
|
+
transparent 70%
|
|
168
|
+
)
|
|
169
|
+
`,
|
|
170
|
+
opacity: 0.9,
|
|
171
|
+
filter: "blur(6px)",
|
|
172
|
+
zIndex: -1,
|
|
173
|
+
} }), _jsx("div", { style: {
|
|
174
|
+
position: "relative",
|
|
175
|
+
borderRadius: "50%",
|
|
176
|
+
overflow: "hidden",
|
|
177
|
+
border: `3px solid rgba(255, 255, 255, 0.2)`,
|
|
178
|
+
}, children: characterImage ? (_jsx(motion.img, { src: characterImage, alt: characterName, animate: {
|
|
179
|
+
scale: isBotSpeaking ? 1.05 : 1,
|
|
180
|
+
}, transition: {
|
|
181
|
+
duration: 0.3,
|
|
182
|
+
ease: "easeInOut",
|
|
183
|
+
}, style: {
|
|
184
|
+
width: "120px",
|
|
185
|
+
height: "120px",
|
|
186
|
+
objectFit: "cover",
|
|
187
|
+
display: "block",
|
|
188
|
+
} })) : (_jsx("div", { style: {
|
|
189
|
+
width: "120px",
|
|
190
|
+
height: "120px",
|
|
191
|
+
backgroundColor: aeroTheme.colors.convai.light + "20",
|
|
192
|
+
display: "flex",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
justifyContent: "center",
|
|
195
|
+
fontSize: "48px",
|
|
196
|
+
color: aeroTheme.colors.convai.light,
|
|
197
|
+
fontWeight: 600,
|
|
198
|
+
}, children: characterName[0]?.toUpperCase() || "C" })) })] }, "center-avatar" // Use key instead of layoutId for independent animation
|
|
199
|
+
)] }), _jsx(AnimatePresence, { children: isActive && (_jsx(motion.div, { initial: { opacity: 0, y: 20 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: -20 }, transition: iosTransitions.fadePop, style: {
|
|
200
|
+
width: "250px",
|
|
201
|
+
height: "80px",
|
|
202
|
+
position: "relative",
|
|
203
|
+
}, children: _jsx("svg", { width: "250", height: "80", style: {
|
|
204
|
+
overflow: "visible",
|
|
205
|
+
}, children: [0, 1, 2].map((waveIndex) => {
|
|
206
|
+
// Calculate wave path based on audio levels
|
|
207
|
+
const points = [];
|
|
208
|
+
const centerY = 40;
|
|
209
|
+
const waveWidth = 250;
|
|
210
|
+
const segments = barsCount;
|
|
211
|
+
// Calculate average audio level for glow intensity
|
|
212
|
+
const avgLevel = audioLevels.reduce((sum, level) => sum + level, 0) / audioLevels.length;
|
|
213
|
+
const glowIntensity = avgLevel * 35; // 0-35px glow (increased from 20)
|
|
214
|
+
// Green color variants for each wave
|
|
215
|
+
const waveColors = [
|
|
216
|
+
aeroTheme.colors.convai.light, // Bright green - front wave
|
|
217
|
+
aeroTheme.colors.convai.light, // Medium green - mid wave
|
|
218
|
+
"#34d399", // Medium-light green - back wave (lighter than dark)
|
|
219
|
+
];
|
|
220
|
+
for (let i = 0; i <= segments; i++) {
|
|
221
|
+
const x = (i / segments) * waveWidth;
|
|
222
|
+
const levelIndex = Math.floor((i / segments) * (audioLevels.length - 1));
|
|
223
|
+
const level = audioLevels[levelIndex] || 0;
|
|
224
|
+
// When idle (low audio), show straight line
|
|
225
|
+
// When active, create waves with increased amplitude
|
|
226
|
+
const phase = (Date.now() / 500 + i * 0.2 + waveIndex * 1.5) % (Math.PI * 2);
|
|
227
|
+
// Only add wave motion when there's audio
|
|
228
|
+
// Idle: amplitude ~0 (straight line)
|
|
229
|
+
// Active: amplitude up to 25px (increased from 15)
|
|
230
|
+
const baseAmplitude = avgLevel > 0.05 ? (2 + waveIndex * 1.5) : 0;
|
|
231
|
+
const amplitude = baseAmplitude + level * (25 - baseAmplitude);
|
|
232
|
+
const y = centerY + Math.sin(phase) * amplitude;
|
|
233
|
+
points.push(`${x},${y}`);
|
|
234
|
+
}
|
|
235
|
+
return (_jsx(motion.path, { d: `M ${points.join(" L ")}`, fill: "none", stroke: waveColors[waveIndex], strokeWidth: 2.5 - waveIndex * 0.4, strokeLinecap: "round", strokeLinejoin: "round", opacity: 0.95 - waveIndex * 0.15, animate: {
|
|
236
|
+
filter: `drop-shadow(0 0 ${glowIntensity}px ${waveColors[waveIndex]}) blur(${waveIndex * 0.3}px)`,
|
|
237
|
+
}, transition: {
|
|
238
|
+
duration: 0.1,
|
|
239
|
+
ease: "easeOut",
|
|
240
|
+
} }, waveIndex));
|
|
241
|
+
}) }) })) }), _jsxs(motion.div, { initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, transition: { delay: 0.2, ...iosTransitions.fadePop }, children: [_jsx("div", { style: {
|
|
242
|
+
fontSize: "16px",
|
|
243
|
+
fontWeight: 600,
|
|
186
244
|
color: aeroTheme.colors.text.primary,
|
|
187
245
|
marginBottom: "0.5rem",
|
|
188
246
|
}, children: isTalking
|
|
189
|
-
?
|
|
247
|
+
? `${characterName} Speaking...`
|
|
190
248
|
: isActive
|
|
191
249
|
? "Listening..."
|
|
192
|
-
: "Voice
|
|
193
|
-
fontSize: "
|
|
250
|
+
: "Voice Mode" }), _jsx("div", { style: {
|
|
251
|
+
fontSize: "13px",
|
|
194
252
|
color: aeroTheme.colors.text.secondary,
|
|
195
|
-
}, children: isActive || isTalking
|
|
196
|
-
? "Audio active"
|
|
197
|
-
: "Press and hold the microphone to talk" })] })] }));
|
|
253
|
+
}, children: isActive || isTalking ? "Audio active" : "Tap microphone to talk" })] })] }));
|
|
198
254
|
};
|
|
199
255
|
//# sourceMappingURL=VoiceModeOverlay.js.map
|