Update README.md

This commit is contained in:
VergilWang15
2022-03-23 16:25:24 +08:00
parent 6a523185cb
commit 9ee3eaec90
2 changed files with 36 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ def select_device(device_type='output'):
def play_pcm_raw():
# path = '../test_audio/test_audio_48k.raw'
# path = '../test_audio/test_audio_48k.raw' # 测试播放48k音频
path = '../recorded_audio/testfile.raw' # 此处的.raw文件即为pcm格式音频
# 解析pcm文件并存放到数据流中
# 需要4个变量文件路径音频通道数采样率音频子类型
@@ -55,7 +55,7 @@ if __name__ == '__main__':
output_channels = settings.MAX_OUTPUT_CHANNEL
device_list = sd.query_devices() # 获取电脑上的所有音频设备
recording()
recording() # 播放音频
while True:
play_pcm_raw()
user_input = input("输入1继续播放输入2退出测试")