-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
你好,这个python版本的quiet用起来比c版本的要更方便,我写了一个demo验证使用quiet.py编码的数据再使用pyaudio发送,正确的播放了声音,但是确无法使用quiet解析它,可以帮忙分析下原因么?代码如下:
`import numpy as np
import pyaudio
from quiet import Encoder, Decoder
CHUNK = 16384 # 每个缓冲区的大小
FORMAT = pyaudio.paFloat32 # 采样位数为16位
CHANNELS = 1 # 声道数为1
RATE = 44100 # 采样率为44100Hz
encoder = Encoder()
#使用 PyAudio 播放音频
p = pyaudio.PyAudio()
stream = p.open(format=pyaudio.paFloat32, channels=1, rate=44100, output=True)
#播放音频
for chunk in encoder.encode('hello, world'):
stream.write(chunk)
#关闭流
stream.stop_stream()
stream.close()
p.terminate()`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels