We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 29f79f6 commit 1f00c24Copy full SHA for 1f00c24
examples/local_audio/full_duplex.py
@@ -92,8 +92,16 @@ def on_track_unsubscribed(
92
# Monitor microphone dB levels
93
async def monitor_mic_db():
94
mic_stream = rtc.AudioStream(track, sample_rate=48000, num_channels=1)
95
+ frame_count = 0
96
+ sample_interval = 5 # Process every 5th frame to reduce load
97
+
98
try:
99
async for frame_event in mic_stream:
100
+ # Skip frames to reduce processing load
101
+ frame_count += 1
102
+ if frame_count % sample_interval != 0:
103
+ continue
104
105
frame = frame_event.frame
106
# Convert frame data to list of samples
107
samples = list(frame.data)
0 commit comments