使用scrcpy录制时,没有声响

在 【打造自己的测试框架】 课程中,使用scrcpy工具录制屏幕,直接用cmd打开,能够正常使用,但是使用python时,不能正常打开,但是案例执行不报错
conftest.py

“”“录屏”""
import os
import signal
import subprocess

import pytest

@pytest.fixture(scope=“module”, autouse=True)
def record_vedio():
print(“录制准备”)
# 使用 scrcpy 工具录屏
command = “scrcpy --record D:\code_hogwarts/actual_combat/frame/tmp.mp4”
# 使用 cmd 命令
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr= subprocess.STDOUT)
print(“录制开始”)
print§
yield
# 结束录制,生成视频
print(“结束录制,生成视频”)
os.kill(p.pid, signal.CTRL_C_EVENT)

test_main.py

from frame.main import Main

class TestMain:

def test_main(self):
    Main().goto_market().goto_search()