From 97da1052f5a069b9b0dc243cbcfda19b18249037 Mon Sep 17 00:00:00 2001 From: Haoyu Xu Date: Sat, 15 Nov 2025 21:22:24 +0800 Subject: [PATCH] feat: remove CN_043 voice bypass for kr and en --- apps/showcase/src/components/voice.js | 10 +--------- packages/charword-table/index.ts | 15 +-------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/apps/showcase/src/components/voice.js b/apps/showcase/src/components/voice.js index 62b1e2f..c804138 100644 --- a/apps/showcase/src/components/voice.js +++ b/apps/showcase/src/components/voice.js @@ -251,15 +251,7 @@ export default class Voice { #nextVoice() { const getVoiceId = () => { - let list = this.#voice.list - if ( - this.#config.language === 'EN' || - this.#config.language === 'KR' - ) { - // filter out CN_043 as this voice is not available in en and kr - list = list.filter((item) => item !== 'CN_043') - } - const id = list[Math.floor(Math.random() * list.length)] + const id = this.#voice.list[Math.floor(Math.random() * this.#voice.list.length)] return id === this.#voice.id.last ? getVoiceId() : id } this.#playVoice(getVoiceId()) diff --git a/packages/charword-table/index.ts b/packages/charword-table/index.ts index 694d92c..14e2155 100644 --- a/packages/charword-table/index.ts +++ b/packages/charword-table/index.ts @@ -156,21 +156,8 @@ export const build = async (namesToBuild: string[]) => { ) const voiceFileList = file.readdirSync(voiceSubFolder) voiceList[voiceSubFolderMapping.lookup_region].map((item) => { - // an exception for detecting file existence if ( - item.endsWith('043') && - voiceFileList.includes(`${item}.ogg`) && - (voiceSubFolderMapping.name === 'kr' || - voiceSubFolderMapping.name === 'en') - ) { - console.log( - `Voice folder ${voiceSubFolderMapping.name} for ${name} has ${item}.ogg` - ) - } - if ( - !voiceFileList.includes(`${item}.ogg`) && - // make an exception - !item.endsWith('043') + !voiceFileList.includes(`${item}.ogg`) ) { err.push( `Voice folder ${voiceSubFolderMapping.name} for ${name} is missing ${item}.ogg`