fix a bug were lc3 streams wouldnt stop

This commit is contained in:
2025-03-04 13:42:12 +01:00
parent dc8b6cc66e
commit b8b4c82be0
2 changed files with 6 additions and 1 deletions

View File

@@ -447,8 +447,13 @@ class Streamer():
lc3_frame = bytes( lc3_frame = bytes(
itertools.islice(big['lc3_frames'], big['lc3_bytes_per_frame']) itertools.islice(big['lc3_frames'], big['lc3_bytes_per_frame'])
) )
if lc3_frame == b'': # Not all streams may stop at the same time
stream_finished[i] = True
continue
else: else:
pcm_frame = await anext(big['audio_input'].frames(big['lc3_frame_samples']), None) pcm_frame = await anext(big['audio_input'].frames(big['lc3_frame_samples']), None)
if pcm_frame is None: # Not all streams may stop at the same time if pcm_frame is None: # Not all streams may stop at the same time
stream_finished[i] = True stream_finished[i] = True
continue continue

View File

@@ -67,7 +67,7 @@ async def send_audio():
""" """
post_data = await request.json post_data = await request.json
try: try:
for key, val in big_conf.items(): for key, val in big_conf.items(): #TODO: loop over caster.big_conf directly
if key in post_data: if key in post_data:
val.audio_source = post_data[key].encode('latin-1') val.audio_source = post_data[key].encode('latin-1')
else: else: