Spaces:
Running

axeronis commited on
Commit
a83ef6d
·
1 Parent(s): bc2c2e5

fix(frontend): Resolve useAudioStream const reassignment and Sidebar import error

Browse files
frontend/app/live/page.tsx CHANGED
@@ -3,7 +3,7 @@
3
  import { useEffect, useState } from 'react';
4
  import { useRouter } from 'next/navigation';
5
  import { LiveConversation } from '@/components/Voice/LiveConversation';
6
- import Sidebar from '@/components/Sidebar'; // Assuming Sidebar exists
7
  import { cn } from '@/lib/utils';
8
 
9
  export default function LiveVoicePage() {
 
3
  import { useEffect, useState } from 'react';
4
  import { useRouter } from 'next/navigation';
5
  import { LiveConversation } from '@/components/Voice/LiveConversation';
6
+ import { Sidebar } from '@/components/Sidebar'; // Assuming Sidebar exists
7
  import { cn } from '@/lib/utils';
8
 
9
  export default function LiveVoicePage() {
frontend/hooks/useAudioStream.ts CHANGED
@@ -135,7 +135,7 @@ export const useAudioStream = (token: string, backendUrl: string = 'ws://localho
135
 
136
  // Helper: Float32 to Int16
137
  const floatTo16BitPCM = (output: Float32Array) => {
138
- const offset = 0;
139
  const buffer = new ArrayBuffer(output.length * 2);
140
  const view = new DataView(buffer);
141
  for (let i = 0; i < output.length; i++, offset += 2) {
 
135
 
136
  // Helper: Float32 to Int16
137
  const floatTo16BitPCM = (output: Float32Array) => {
138
+ let offset = 0;
139
  const buffer = new ArrayBuffer(output.length * 2);
140
  const view = new DataView(buffer);
141
  for (let i = 0; i < output.length; i++, offset += 2) {