bugfix
This commit is contained in:
parent
f4822d38b9
commit
0371c9c671
@ -18,9 +18,9 @@ def bytes_to_audio_frame(bytes_data, format='s16', layout='mono', sample_rate=16
|
|||||||
- sample_rate: 采样率。
|
- sample_rate: 采样率。
|
||||||
"""
|
"""
|
||||||
# 根据给定的参数创建AudioFrame
|
# 根据给定的参数创建AudioFrame
|
||||||
frame = AudioFrame(format=format, layout=layout,
|
frame = AudioFrame(format=format,
|
||||||
samples=len(bytes_data) // 2,
|
layout=layout,
|
||||||
rate=sample_rate)
|
samples=len(bytes_data) // 2)
|
||||||
|
|
||||||
# 将字节数据复制到AudioFrame中
|
# 将字节数据复制到AudioFrame中
|
||||||
frame.planes[0].update(bytes_data)
|
frame.planes[0].update(bytes_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user