From 69b6d9d970a9eae8d7c9e085201ba888ef4ef54b Mon Sep 17 00:00:00 2001 From: MediaPipe Team Date: Wed, 21 Dec 2022 17:39:54 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 497043596 --- mediapipe/web/graph_runner/graph_runner.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mediapipe/web/graph_runner/graph_runner.ts b/mediapipe/web/graph_runner/graph_runner.ts index a9bb979af..ef866bc91 100644 --- a/mediapipe/web/graph_runner/graph_runner.ts +++ b/mediapipe/web/graph_runner/graph_runner.ts @@ -1028,7 +1028,9 @@ export class GraphRunner { // Set up our TS listener to receive any packets for this stream, and // additionally reformat our Uint8Array into a Float32Array for the user. this.setListener(outputStreamName, (data: Uint8Array) => { - const floatArray = new Float32Array(data.buffer); // Should be very fast + // Should be very fast + const floatArray = + new Float32Array(data.buffer, data.byteOffset, data.length / 4); callbackFcn(floatArray); });