Compare commits

..

4 Commits

Author SHA1 Message Date
Qishuai Liu df96ad574a
Merge 9d12dd1e54 into d54568642b 2025-05-16 14:11:33 +00:00
Qishuai Liu 9d12dd1e54
fix: audio rtp timestamp 2025-05-16 23:11:22 +09:00
Marc Brooks d54568642b
fix(ui): Fix regression on Shift-Backspace not being handled (#454)
This keystroke is valid and means "delete to the right" on MacOS.
2025-05-16 12:38:56 +02:00
Marc Brooks c9068af568
Update devcontainer.json to match ui package.json (#457)
Missed that we upgraded the ui's package.json, need to _also_ update the devcontainer.json to matching verison 22.15.0
2025-05-16 12:37:54 +02:00
3 changed files with 19 additions and 4 deletions

View File

@ -4,7 +4,7 @@
"features": {
"ghcr.io/devcontainers/features/node:1": {
// Should match what is defined in ui/package.json
"version": "21.1.0"
"version": "22.15.0"
}
},
"mounts": [

View File

@ -12,6 +12,7 @@ import (
"time"
"github.com/jetkvm/kvm/resource"
"github.com/pion/rtp"
"github.com/pion/webrtc/v4/pkg/media"
)
@ -243,6 +244,8 @@ func handleAudioClient(conn net.Conn) {
scopedLogger.Info().Msg("native audio socket client connected")
inboundPacket := make([]byte, maxAudioFrameSize)
var timestamp uint32
var packet rtp.Packet
for {
n, err := conn.Read(inboundPacket)
if err != nil {
@ -250,10 +253,21 @@ func handleAudioClient(conn net.Conn) {
return
}
logger.Info().Msgf("audio socket msg: %d", n)
if currentSession != nil {
if _, err := currentSession.AudioTrack.Write(inboundPacket[:n]); err != nil {
if err := packet.Unmarshal(inboundPacket[:n]); err != nil {
scopedLogger.Warn().Err(err).Msg("error unmarshalling audio socket packet")
continue
}
timestamp += 960
packet.Header.Timestamp = timestamp
buf, err := packet.Marshal()
if err != nil {
scopedLogger.Warn().Err(err).Msg("error marshalling packet")
continue
}
if _, err := currentSession.AudioTrack.Write(buf); err != nil {
scopedLogger.Warn().Err(err).Msg("error writing sample")
}
}

View File

@ -243,6 +243,7 @@ export const keyDisplayMap: Record<string, string> = {
Escape: "esc",
Tab: "tab",
Backspace: "backspace",
"(Backspace)": "backspace",
Enter: "enter",
CapsLock: "caps lock",
ShiftLeft: "shift",