@@ -84,7 +84,7 @@ public struct BarAudioVisualizer: View {
8484 @State private var animationTask : Task < Void , Never > ?
8585
8686 public init ( audioTrack: AudioTrack ? ,
87- agentState: AgentState = . unknown ,
87+ agentState: AgentState = . speaking ,
8888 barColor: Color = . primary,
8989 barCount: Int = 5 ,
9090 barCornerRadius: CGFloat = 100 ,
@@ -180,21 +180,19 @@ extension BarAudioVisualizer {
180180
181181 func duration( agentState: AgentState ) -> TimeInterval {
182182 switch agentState {
183- case . connecting , . initializing: 2 / Double( barCount)
183+ case . idle , . initializing: 2 / Double( barCount)
184184 case . listening: 0.5
185185 case . thinking: 0.15
186186 case . speaking: veryLongDuration
187- default : veryLongDuration
188187 }
189188 }
190189
191190 func highlightingSequence( agentState: AgentState ) -> [ HighlightedBars ] {
192191 switch agentState {
193- case . connecting, . initializing: ( 0 ..< barCount) . map { HighlightedBars ( [ $0, barCount - 1 - $0] ) }
194- case . thinking: Array ( ( 0 ..< barCount) + ( 0 ..< barCount) . reversed ( ) ) . map { HighlightedBars ( [ $0] ) }
192+ case . idle, . initializing: ( 0 ..< barCount) . map { HighlightedBars ( [ $0, barCount - 1 - $0] ) }
195193 case . listening: barCount % 2 == 0 ? [ [ ( barCount / 2 ) - 1 , barCount / 2 ] , [ ] ] : [ [ barCount / 2 ] , [ ] ]
196- case . speaking , . unknown : [ HighlightedBars ( 0 ..< barCount) ]
197- case . disconnected : [ [ ] ]
194+ case . thinking : Array ( ( 0 ..< barCount ) + ( 0 ..< barCount) . reversed ( ) ) . map { HighlightedBars ( [ $0 ] ) }
195+ case . speaking : [ HighlightedBars ( 0 ..< barCount ) ]
198196 }
199197 }
200198 }
0 commit comments