Spaces:
Running
Running
Update pages/GameMonster.tsx
Browse files- pages/GameMonster.tsx +2 -1
pages/GameMonster.tsx
CHANGED
|
@@ -86,7 +86,8 @@ export const GameMonster: React.FC = () => {
|
|
| 86 |
// 1. Process Input (Audio or Decay)
|
| 87 |
let volume = 0;
|
| 88 |
if (!useKeyboardMode && analyserRef.current && dataArrayRef.current) {
|
| 89 |
-
|
|
|
|
| 90 |
const avg = dataArrayRef.current.reduce((a,b)=>a+b) / dataArrayRef.current.length;
|
| 91 |
volume = avg;
|
| 92 |
} else if (useKeyboardMode) {
|
|
|
|
| 86 |
// 1. Process Input (Audio or Decay)
|
| 87 |
let volume = 0;
|
| 88 |
if (!useKeyboardMode && analyserRef.current && dataArrayRef.current) {
|
| 89 |
+
// Cast to any to avoid TS mismatch between Uint8Array<ArrayBuffer> and Uint8Array<ArrayBufferLike>
|
| 90 |
+
analyserRef.current.getByteFrequencyData(dataArrayRef.current as any);
|
| 91 |
const avg = dataArrayRef.current.reduce((a,b)=>a+b) / dataArrayRef.current.length;
|
| 92 |
volume = avg;
|
| 93 |
} else if (useKeyboardMode) {
|