mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
gwah
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
|
||||
<title>Multi Roomba Rover</title>
|
||||
<script type="module" crossorigin src="/assets/index-CXj15_94.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-CG8JYWgy.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-WqYsCIRI.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -450,6 +450,9 @@ function decodeMicChunk(payload = {}) {
|
||||
if (Buffer.isBuffer(binary)) {
|
||||
return binary;
|
||||
}
|
||||
if (binary && typeof binary === 'object' && binary.type === 'Buffer' && Array.isArray(binary.data)) {
|
||||
return Buffer.from(binary.data);
|
||||
}
|
||||
if (binary instanceof Uint8Array) {
|
||||
return Buffer.from(binary.buffer, binary.byteOffset, binary.byteLength);
|
||||
}
|
||||
@@ -474,6 +477,9 @@ function pushMicChunk(roverId, ownerSocketId, payload = {}) {
|
||||
if (!bytes.length) {
|
||||
throw new Error('Mic chunk missing');
|
||||
}
|
||||
if (bytes.length % 2 !== 0) {
|
||||
throw new Error('Mic chunk has invalid PCM byte length');
|
||||
}
|
||||
if (bytes.length > 64 * 1024) {
|
||||
throw new Error('Mic chunk too large');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user