@@ -63,24 +63,50 @@ class RecordingsService {
6363 const text = transcription . text . toLowerCase ( ) ;
6464
6565 if ( text . includes ( 'start recording' ) ) {
66- await this . startRecording ( userId , sessionId ) ;
66+ // Send event before starting recording
67+ streamService . broadcastToUser ( userId , 'voice-command' , {
68+ command : 'start-recording' ,
69+ timestamp : Date . now ( )
70+ } ) ;
71+
72+ const recordingId = await this . startRecording ( userId , sessionId ) ;
73+
6774 session . layouts . showReferenceCard (
6875 "Recording Started" ,
6976 "Say 'stop recording' when done" ,
7077 { view : ViewType . MAIN , durationMs : 3000 }
7178 ) ;
79+
80+ // Send additional confirmation event with the ID
81+ streamService . broadcastToUser ( userId , 'recording-started-by-voice' , {
82+ id : recordingId ,
83+ timestamp : Date . now ( )
84+ } ) ;
7285 }
7386 else if ( text . includes ( 'stop recording' ) ) {
87+ // Send event before stopping recording
88+ streamService . broadcastToUser ( userId , 'voice-command' , {
89+ command : 'stop-recording' ,
90+ timestamp : Date . now ( )
91+ } ) ;
92+
7493 const recording = Array . from ( this . activeRecordings . values ( ) )
7594 . find ( r => r . sessionId === sessionId && r . userId === userId ) ;
7695
7796 if ( recording ) {
7897 await this . stopRecording ( recording . recordingId ) ;
98+
7999 session . layouts . showReferenceCard (
80100 "Recording Stopped" ,
81101 "Processing your recording..." ,
82102 { view : ViewType . MAIN , durationMs : 3000 }
83103 ) ;
104+
105+ // Send additional confirmation event with the ID
106+ streamService . broadcastToUser ( userId , 'recording-stopped-by-voice' , {
107+ id : recording . recordingId ,
108+ timestamp : Date . now ( )
109+ } ) ;
84110 }
85111 }
86112 }
0 commit comments