feat: remove CN_043 voice bypass for kr and en
This commit is contained in:
@@ -251,15 +251,7 @@ export default class Voice {
|
|||||||
|
|
||||||
#nextVoice() {
|
#nextVoice() {
|
||||||
const getVoiceId = () => {
|
const getVoiceId = () => {
|
||||||
let list = this.#voice.list
|
const id = this.#voice.list[Math.floor(Math.random() * this.#voice.list.length)]
|
||||||
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)]
|
|
||||||
return id === this.#voice.id.last ? getVoiceId() : id
|
return id === this.#voice.id.last ? getVoiceId() : id
|
||||||
}
|
}
|
||||||
this.#playVoice(getVoiceId())
|
this.#playVoice(getVoiceId())
|
||||||
|
|||||||
@@ -156,21 +156,8 @@ export const build = async (namesToBuild: string[]) => {
|
|||||||
)
|
)
|
||||||
const voiceFileList = file.readdirSync(voiceSubFolder)
|
const voiceFileList = file.readdirSync(voiceSubFolder)
|
||||||
voiceList[voiceSubFolderMapping.lookup_region].map((item) => {
|
voiceList[voiceSubFolderMapping.lookup_region].map((item) => {
|
||||||
// an exception for detecting file existence
|
|
||||||
if (
|
if (
|
||||||
item.endsWith('043') &&
|
!voiceFileList.includes(`${item}.ogg`)
|
||||||
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')
|
|
||||||
) {
|
) {
|
||||||
err.push(
|
err.push(
|
||||||
`Voice folder ${voiceSubFolderMapping.name} for ${name} is missing ${item}.ogg`
|
`Voice folder ${voiceSubFolderMapping.name} for ${name} is missing ${item}.ogg`
|
||||||
|
|||||||
Reference in New Issue
Block a user