Update README.md
This commit is contained in:
@@ -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退出测试")
|
||||
|
||||
Reference in New Issue
Block a user