This commit is contained in:
yumoqing 2024-09-11 15:15:12 +08:00
parent 5aea5a4752
commit 9d77a8f565

View File

@ -1,4 +1,5 @@
import io import io
import asyncio
from av import AudioFrame from av import AudioFrame
from aiortc import VideoStreamTrack, AudioStreamTrack from aiortc import VideoStreamTrack, AudioStreamTrack
@ -18,6 +19,7 @@ class LLMAudioStreamTrack(AudioStreamTrack):
print('LLMAudioStreamTrack return None ...') print('LLMAudioStreamTrack return None ...')
return b return b
frame = AudioFrame.from_ndarray(io.BytesIO(b), format='s16', layout='mono') frame = AudioFrame.from_ndarray(io.BytesIO(b), format='s16', layout='mono')
print('LLMAudioStreamTrack return frame ...')
return frame return frame
except Exception as e: except Exception as e:
print_exc() print_exc()