@@ -104,9 +104,7 @@ def draw_timestamp(self, canvas: np.ndarray, fps: float):
104104 y = int ((height - text_height ) * 0.4 + baseline )
105105 cv2 .putText (canvas , text , (x , y ), font_face , font_scale , (0 , 0 , 0 ), thickness )
106106
107- def draw_current_wave (
108- self , canvas : np .ndarray , audio_samples : np .ndarray
109- ) -> np .ndarray :
107+ def draw_current_wave (self , canvas : np .ndarray , audio_samples : np .ndarray ) -> np .ndarray :
110108 """Draw the current waveform and return the current values"""
111109 height , width = canvas .shape [:2 ]
112110 center_y = height // 2 + 100
@@ -136,9 +134,7 @@ def draw_volume_history(self, canvas: np.ndarray, current_volume: float):
136134 center_y = height // 2
137135
138136 self .volume_history .append (current_volume )
139- cv2 .line (
140- canvas , (0 , center_y - 250 ), (width , center_y - 250 ), (200 , 200 , 200 ), 1
141- )
137+ cv2 .line (canvas , (0 , center_y - 250 ), (width , center_y - 250 ), (200 , 200 , 200 ), 1 )
142138
143139 volume_x = np .linspace (0 , width , len (self .volume_history ), dtype = int )
144140 volume_y = center_y - 250 + (np .array (self .volume_history ) * 200 )
@@ -158,9 +154,7 @@ async def video_generator(
158154 input_audio : asyncio .Queue [Union [rtc .AudioFrame , _AudioEndSentinel ]],
159155 av_sync : rtc .AVSynchronizer , # only used for drawing the actual fps on the video
160156) -> AsyncIterable [tuple [rtc .VideoFrame , Optional [rtc .AudioFrame ]]]:
161- canvas = np .zeros (
162- (media_info .video_height , media_info .video_width , 4 ), dtype = np .uint8
163- )
157+ canvas = np .zeros ((media_info .video_height , media_info .video_width , 4 ), dtype = np .uint8 )
164158 canvas .fill (255 )
165159
166160 def _np_to_video_frame (image : np .ndarray ) -> rtc .VideoFrame :
0 commit comments