音频配置参数引入

This commit is contained in:
杍超
2025-02-12 14:52:27 +08:00
parent 7179a577f2
commit a1f3079232
4 changed files with 38 additions and 9 deletions

View File

@@ -97,6 +97,22 @@ with gr.Blocks(css=css) as demo:
mode="send-receive",
video_chat=True,
elem_id="video-source",
track_constraints={
"video": {
"facingMode": "user",
"width": {"ideal": 500},
"height": {"ideal": 500},
"frameRate": {"ideal": 30},
},
"audio": {
"echoCancellation": True,
"noiseSuppression": {"exact": True},
"autoGainControl": {"exact": False},
"sampleRate": {"ideal": 24000},
"sampleSize": {"ideal": 16},
"channelCount": {"exact": 1},
},
}
)
webrtc.stream(
VideoChatHandler(),