✨ Fake call audio level
This commit is contained in:
@@ -49,20 +49,12 @@ sealed class CallParticipantLive with _$CallParticipantLive {
|
||||
}) = _CallParticipantLive;
|
||||
|
||||
bool get isSpeaking {
|
||||
// Simple speaking detection based on audio level analysis
|
||||
// This is a basic implementation - in a real app you'd want more sophisticated VAD
|
||||
final stream = remoteParticipant.remoteStream;
|
||||
if (stream == null) return false;
|
||||
|
||||
// Check if any audio tracks are enabled and have recent activity
|
||||
final audioTracks = stream.getAudioTracks();
|
||||
if (audioTracks.isEmpty) return false;
|
||||
|
||||
// For now, just return true if audio is enabled (simplified)
|
||||
// In a real implementation, you'd analyze audio levels using WebRTC stats
|
||||
return remoteParticipant.isAudioEnabled;
|
||||
// Use the actual audio level from WebRTC monitoring
|
||||
return remoteParticipant.audioLevel > 0.1; // Threshold for speaking
|
||||
}
|
||||
|
||||
double get audioLevel => remoteParticipant.audioLevel;
|
||||
|
||||
bool get isMuted => !remoteParticipant.isAudioEnabled;
|
||||
bool get isScreenSharing => remoteParticipant.isVideoEnabled; // Simplified
|
||||
bool get isScreenSharingWithAudio => false; // TODO: Implement screen sharing
|
||||
@@ -88,6 +80,7 @@ class CallNotifier extends _$CallNotifier {
|
||||
|
||||
String? _roomId;
|
||||
String? get roomId => _roomId;
|
||||
WebRTCManager? get webrtcManager => _webrtcManager;
|
||||
|
||||
@override
|
||||
CallState build() {
|
||||
|
Reference in New Issue
Block a user