imports
import jsonimport avimport numpy as npimport structcontainer = av.open('./webcam/friday.mp3',format='mp3')for stream in container.streams:if stream.type == 'audio':format = stream.format.namebreakfor frame in container.decode(audio=0):sia = frame.to_ndarray(format='s16', layout='stereo')siai = (sia \*32767).astype(np.int16)si = siai.tobytes()soa = np.frombuffer(si, dtype=siai.dtype)soar = soa.reshape(2,-1) so = av.AudioFrame.from_ndarray(soar)
#Above is my Code and Below is my error
Traceback (most recent call last): File "/media/eizen/HDD2/srinivas/cv/github/aiortc/examples/webcam/producer.py", line 67, in <module> so = av.AudioFrame.from_ndarray(soara) File "av/audio/frame.pyx", line 125, in av.audio.frame.AudioFrame.from_ndarray File "av/utils.pyx", line 80, in av.utils.check_ndarray_shapeValueError: Unexpected numpy array shape `(2, 47)`