@@ -155,7 +155,7 @@ def get_peak_level(frame: AudioFrame) -> float:
155
155
output_file .close ()
156
156
157
157
158
- def process_audio_clip (clip : Clip , data : np .ndarray , sr : int ) -> np .ndarray :
158
+ def process_audio_clip (clip : Clip , data : np .ndarray , sr : int , log : Log ) -> np .ndarray :
159
159
to_s16 = bv .AudioResampler (format = "s16" , layout = "stereo" , rate = sr )
160
160
input_buffer = BytesIO ()
161
161
@@ -217,6 +217,9 @@ def process_audio_clip(clip: Clip, data: np.ndarray, sr: int) -> np.ndarray:
217
217
except (bv .BlockingIOError , bv .EOFError ):
218
218
break
219
219
220
+ if not all_frames :
221
+ log .debug (f"No audio frames at { clip = } " )
222
+ return np .zeros_like (data )
220
223
return np .concatenate (all_frames , axis = 1 )
221
224
222
225
@@ -473,7 +476,7 @@ def _make_new_audio(tl: v3, fmt: bv.AudioFormat, args: Args, log: Log) -> list[A
473
476
474
477
if clip .speed != 1 or clip .volume != 1 :
475
478
clip_arr = process_audio_clip (
476
- clip , getter .get (samp_start , samp_end ), sr
479
+ clip , getter .get (samp_start , samp_end ), sr , log
477
480
)
478
481
else :
479
482
clip_arr = getter .get (samp_start , samp_end )
0 commit comments