Sync local version

This commit is contained in:
2026-01-26 01:16:35 +08:00
parent 3ad32da21a
commit c1202c2ca2
27 changed files with 16595 additions and 2369 deletions

View File

@@ -1412,6 +1412,13 @@ select.input { cursor: pointer; }
<label class="form-label">名称</label>
<input type="text" id="newVoiceName" class="input" placeholder="显示名称">
</div>
<div class="form-group">
<label class="form-label">复刻版本</label>
<select id="newVoiceResourceId" class="input">
<option value="seed-icl-2.0">复刻 2.0</option>
<option value="seed-icl-1.0">复刻 1.0</option>
</select>
</div>
<button class="btn btn-primary" id="addMySpeakerBtn" style="margin-top: 18px;"><i class="fa-solid fa-plus"></i></button>
</div>
</div>
@@ -2155,6 +2162,7 @@ function normalizeMySpeakers(list) {
name: String(item?.name || '').trim(),
value: String(item?.value || '').trim(),
source: item?.source || getVoiceSource(item?.value || ''),
resourceId: item?.resourceId || null,
})).filter(item => item.value);
}
@@ -2265,11 +2273,14 @@ function doTestVoice(speaker, source, textElId, statusElId) {
setTestStatus(statusElId, 'playing', '正在合成...');
const speakerItem = mySpeakers.find(s => s.value === speaker);
const resolvedResourceId = speakerItem?.resourceId;
post('xb-tts:test-speak', {
text,
speaker,
source,
resourceId: source === 'auth' ? inferResourceIdBySpeaker(speaker) : '',
resourceId: source === 'auth' ? (resolvedResourceId || inferResourceIdBySpeaker(speaker)) : '',
});
}
@@ -2437,10 +2448,11 @@ document.addEventListener('DOMContentLoaded', () => {
$('addMySpeakerBtn').addEventListener('click', () => {
const id = $('newVoiceId').value.trim();
const name = $('newVoiceName').value.trim();
const resourceId = $('newVoiceResourceId').value;
if (!id) { post('xb-tts:toast', { type: 'error', message: '请输入音色ID' }); return; }
if (!isInMyList(id)) {
mySpeakers.push({ name: name || id, value: id, source: 'auth' });
mySpeakers.push({ name: name || id, value: id, source: 'auth', resourceId });
}
selectedVoiceValue = id;
$('newVoiceId').value = '';