Skip to content

Commit

Permalink
Add: Configマイグレーションにプリセットに文内無音倍率を追加し、プロジェクトファイルのマイグレーションを更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba committed Nov 12, 2024
1 parent 8dcc83b commit 7694492
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
11 changes: 11 additions & 0 deletions src/backend/common/ConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ const migrations: [string, (store: Record<string, unknown>) => 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 = {
Expand Down
9 changes: 8 additions & 1 deletion src/domain/project/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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`関数で検証される
Expand Down

0 comments on commit 7694492

Please sign in to comment.