File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -83,33 +83,34 @@ async function generateContent(
8383 async function handleTurn ( ) {
8484 const audioFrames = [ ] ;
8585 let done = false ;
86-
86+ //todo
8787 while ( ! done ) {
8888 const message = await waitMessage ( ) ;
8989 const sc = message . serverContent ;
9090
91- if ( sc . inputTranscription ) {
91+ if ( sc ? .inputTranscription ) {
9292 console . log ( 'Input transcription' , sc . inputTranscription ) ;
9393 }
94- if ( sc . outputTranscription ) {
94+ if ( sc ? .outputTranscription ) {
9595 console . log ( 'Output transcription' , sc . outputTranscription ) ;
9696 }
97- if ( sc . modelTurn . parts ) {
97+ if ( sc ? .modelTurn ? .parts ) {
9898 for ( const part of sc . modelTurn . parts ) {
99- if ( part . inlineData . data ) {
99+ if ( part . inlineData ? .data ) {
100100 const audioData = Buffer . from ( part . inlineData . data , 'base64' ) ;
101101 audioFrames . push ( audioData ) ;
102102 }
103103 }
104104 }
105- if ( sc . turnComplete ) {
105+ if ( sc ? .turnComplete ) {
106106 done = true ;
107107 }
108108 }
109109
110110 return audioFrames ;
111111 }
112112
113+
113114 const session = await client . live . connect ( {
114115 model : MODEL ,
115116 config : {
You can’t perform that action at this time.
0 commit comments