From 7694492bddb57aaedaa004aa954b7b11b4e9e0f1 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Wed, 13 Nov 2024 08:48:09 +0900 Subject: [PATCH] =?UTF-8?q?Add:=20Config=E3=83=9E=E3=82=A4=E3=82=B0?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=AB=E3=83=97?= =?UTF-8?q?=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88=E3=81=AB=E6=96=87=E5=86=85?= =?UTF-8?q?=E7=84=A1=E9=9F=B3=E5=80=8D=E7=8E=87=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=97=E3=80=81=E3=83=97=E3=83=AD=E3=82=B8=E3=82=A7=E3=82=AF?= =?UTF-8?q?=E3=83=88=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=81=AE=E3=83=9E?= =?UTF-8?q?=E3=82=A4=E3=82=B0=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/common/ConfigManager.ts | 11 +++++++++++ src/domain/project/index.ts | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/backend/common/ConfigManager.ts b/src/backend/common/ConfigManager.ts index 20a00ee282..22f5db1d28 100644 --- a/src/backend/common/ConfigManager.ts +++ b/src/backend/common/ConfigManager.ts @@ -265,6 +265,17 @@ const migrations: [string, (store: Record) => unknown][] = [ return config; }, ], + [ + ">=0.22", + (config) => { + // プリセットに文内無音倍率を追加 + const presets = config.presets as ConfigType["presets"]; + for (const preset of Object.values(presets.items)) { + if (preset == undefined) throw new Error("preset == undefined"); + preset.pauseLengthScale = 1; + } + }, + ], ]; export type Metadata = { diff --git a/src/domain/project/index.ts b/src/domain/project/index.ts index 1deb9974a7..593d81f42c 100644 --- a/src/domain/project/index.ts +++ b/src/domain/project/index.ts @@ -127,7 +127,6 @@ export const migrateProjectFileObject = async ( projectData.audioItems[audioItemsKey].query.volumeScale = 1; projectData.audioItems[audioItemsKey].query.prePhonemeLength = 0.1; projectData.audioItems[audioItemsKey].query.postPhonemeLength = 0.1; - projectData.audioItems[audioItemsKey].query.pauseLengthScale = 1; projectData.audioItems[audioItemsKey].query.outputSamplingRate = DEFAULT_SAMPLING_RATE; } @@ -303,6 +302,14 @@ export const migrateProjectFileObject = async ( projectData.song.trackOrder = Object.keys(newTracks); } + if (semver.satisfies(projectAppVersion, "<0.22.0", semverSatisfiesOptions)) { + // 文内無音倍率の追加 + for (const audioItemsKey in projectData.talk.audioItems) { + projectData.talk.audioItems[audioItemsKey].query.pauseLengthScale = 1; + console.log(projectData.talk.audioItems[audioItemsKey].query); + } + } + // Validation check // トークはvalidateTalkProjectで検証する // ソングはSET_SCOREの中の`isValidScore`関数で検証される