n duration
            } else if (callback) {
                callback();
            }
        }

        // Initialize TTS if requested
        if (urlParams.has('tts') && window.initTTS) {
            window.initTTS({
                lang: urlParams.get('tts') || urlParams.get('lang') || 'en-US',
                pitch: parseFloat(urlParams.get('pitch') || '1'),
                rate: parseFloat(urlParams.get('rate') || '1'),
                voice: urlParams.get('voice') || null
            })