Skip to content

Commit

Permalink
added ui cookbook audio indicator docs
Browse files Browse the repository at this point in the history
  • Loading branch information
deven98 committed Sep 19, 2023
1 parent 0707bb7 commit 61092a5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Audio Volume Indicator

The audio indicator provides visual feedback when a user connected to the call is speaking.

You can observe several things about audio in the `CallParticipantState` class such as:

* Check if the current user is the dominant speaker: `participantState.isDominantSpeaker`
* Check if the current user is speaking: `participantState.isSpeaking`
* Check the audio level of the user: `participantState.audioLevel`

## Customising the audio volume indicator

You can change the color of the audio indicator using the `audioLevelIndicatorColor` parameter of the `StreamCallParticipant` widget:

```dart
StreamCallContainer(
// ...
callContentBuilder: (
BuildContext context,
Call call,
CallState callState,
) {
return StreamCallContent(
call: call,
callState: callState,
callParticipantsBuilder: (
BuildContext context,
Call call,
CallState callState,
) {
return StreamCallParticipants(
call: call,
participants: callState.callParticipants,
callParticipantBuilder: (
BuildContext context,
Call call,
CallParticipantState participantState,
) {
return StreamCallParticipant(
call: call,
participant: participantState,
audioLevelIndicatorColor: Colors.teal,
);
},
);
},
);
},
),
```

0 comments on commit 61092a5

Please sign in to comment.