Skip to content

Commit 7566c60

Browse files
committed
wip
1 parent a7e5216 commit 7566c60

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

livekit-rtc/jupyter-html/src/App.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const LeaveIcon = (props: SVGProps<SVGSVGElement>) => (
4444

4545
const ConnectedContent: React.FC<{ onDisconnect: () => void }> = ({ onDisconnect }) => {
4646
const connectionState = useConnectionState();
47-
const { state: agentState, audioTrack: agentTrack } = useVoiceAssistant();
4847
const { canPlayAudio } = useStartAudio({ props: {} }); // why do I need props..?
48+
const { state: agentState, audioTrack } = useVoiceAssistant();
4949

5050
return (
5151
<div className="content">
@@ -63,16 +63,16 @@ const ConnectedContent: React.FC<{ onDisconnect: () => void }> = ({ onDisconnect
6363
<div className="controls">
6464
<VoiceAssistantControlBar controls={{ microphone: true, leave: false }} />
6565

66-
{canPlayAudio && connectionState == ConnectionState.Connected && <div className="agent-visualizer">
66+
{canPlayAudio && connectionState == ConnectionState.Connected && agentState !== "connecting" && <div className="agent-visualizer">
6767
<BarVisualizer
6868
state={agentState}
6969
barCount={15}
70-
trackRef={agentTrack}
71-
options={{ minHeight: 30, maxHeight: 30 }}
70+
trackRef={audioTrack}
71+
options={{ minHeight: 15, maxHeight: 30 }}
7272
/>
7373
</div>}
7474
</div>
75-
</div>
75+
</div >
7676
);
7777
};
7878

livekit-rtc/livekit/rtc/jupyter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def room_html(url: str, token: str) -> HTML:
3131
index_path = _resource_stack.enter_context(as_file(index_path))
3232

3333
# turns out that directly replacing the URL/token is necessary, as Colab or Jupyter comms become
34-
# unreliable when the main thread is busy/blocked
34+
# unreliable when the main thread is busy/blocked.
35+
# it also avoid the need to use --expose-app-in-browser when starting jupyter notebook
3536
html_text = index_path.read_text()
3637
html_text = html_text.replace(token_placeholder, token)
3738
html_text = html_text.replace(url_placeholder, url)

livekit-rtc/livekit/rtc/resources/jupyter-html/index.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)