File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -132,15 +132,16 @@ export function mixAudioBuffers(buffers: Float32Array[]): Float32Array {
132132 const len = Math . min ( buffer . length , mixed . length ) ;
133133 for ( let i = 0 ; i < len ; i ++ ) {
134134 // Float32Array elements are initialized to 0 and accessed within bounds
135- // TypeScript requires ?? 0 for array indexing even though values are always defined
135+ // ?? 0 required due to noUncheckedIndexedAccess: true in tsconfig.json
136136 mixed [ i ] = ( mixed [ i ] ?? 0 ) + ( buffer [ i ] ?? 0 ) ;
137137 }
138138 }
139139
140140 // Normalize by buffer count to prevent clipping
141141 const scale = 1 / buffers . length ;
142142 for ( let i = 0 ; i < mixed . length ; i ++ ) {
143- mixed [ i ] = mixed [ i ] * scale ;
143+ // ?? 0 required due to noUncheckedIndexedAccess: true in tsconfig.json
144+ mixed [ i ] = ( mixed [ i ] ?? 0 ) * scale ;
144145 }
145146
146147 return mixed ;
You can’t perform that action at this time.
0 commit comments