del);
        addHistoryItem(text, voice || model, audioBlob);
        showStatus(lang === 'en' ? 'Audio generated successfully!' : '语音生成成功！', 'success');
        
    } catch (error) {
        console.error('Error generating audio:', error);
        showStatus(`${lang === 'en' ? 'Error: ' : '错误: '}${error.message}`, 'error');
    } finally {
        setButtonState('idle'); 
        loadingIndicator.style.display = 'none';
    }
}
function updateCurrentVoiceDisplay(voiceOrModel) {
    cons