fix a bug were lc3 streams wouldnt stop
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user