File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,9 @@ async def main() -> None:
2121 token = os .getenv ("LIVEKIT_TOKEN" )
2222 # check for either token or api_key and api_secret
2323 if not url or (not token and (not api_key or not api_secret )):
24- raise RuntimeError ("LIVEKIT_TOKEN or LIVEKIT_API_KEY and LIVEKIT_API_SECRET must be set in env" )
24+ raise RuntimeError (
25+ "LIVEKIT_TOKEN or LIVEKIT_API_KEY and LIVEKIT_API_SECRET must be set in env"
26+ )
2527
2628 room = rtc .Room ()
2729
@@ -98,14 +100,14 @@ async def monitor_mic_db():
98100 mic_stream = rtc .AudioStream (track , sample_rate = 48000 , num_channels = 1 )
99101 frame_count = 0
100102 sample_interval = 5 # Process every 5th frame to reduce load
101-
103+
102104 try :
103105 async for frame_event in mic_stream :
104106 # Skip frames to reduce processing load
105107 frame_count += 1
106108 if frame_count % sample_interval != 0 :
107109 continue
108-
110+
109111 frame = frame_event .frame
110112 # Convert frame data to list of samples
111113 samples = list (frame .data )
You can’t perform that action at this time.
0 commit comments