;
                        speechRecognizer.close();
                    }
                );
            }).catch((reason) => console.log(reason));

            return res;
        }
        
        // Aligns two token lists using SequenceMatcher and handles differences.
        // Equal segments are copied directly.
        // 'Replace' segments are aligned strictly if identical after joining,
        // otherwise aligned using alignRawTokensByRef().
        // 'Delete' segments from raw are preserved.
  