Skip to content
Merged
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
2 changes: 1 addition & 1 deletion VoiceAssistant.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
repositoryURL = "https://github.com/livekit/components-swift";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 0.1.1;
minimumVersion = 0.1.2;
};
};
B5E1B9102D14E9F500A38CB6 /* XCRemoteSwiftPackageReference "client-sdk-swift" */ = {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 3 additions & 13 deletions VoiceAssistant/StatusView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,12 @@ struct StatusView: View {
}

// Reads the agent state property which is updated automatically
private var agentState: AgentState? {
private var agentState: AgentState {
agentParticipant?.agentState ?? .initializing
}

var body: some View {
if let track = agentParticipant?.firstAudioTrack {
BarAudioVisualizer(audioTrack: track, barColor: .primary, barCount: 5)
.opacity(agentState == .speaking ? 1 : 0.3)
.animation(
.easeInOut(duration: 1)
.repeatForever(autoreverses: true)
.speed(agentState == .thinking ? 5 : 1),
value: agentState)
} else {
// Placeholder for when agent audio isn't available yet, so the app geometry doesn't change
Rectangle().fill(.clear)
}
AgentBarAudioVisualizer(audioTrack: agentParticipant?.firstAudioTrack, agentState: agentState, barColor: .primary, barCount: 5)
.id(agentParticipant?.firstAudioTrack?.id)
}
}