Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ソング:音量が正しく生成されていないのを修正 #2030

Merged
merged 3 commits into from
Apr 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/store/singing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,8 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
`Fetched frame audio query. Phonemes are "${phonemes}".`,
);

// 音域調整を適用する
shiftGuidePitch(keyRangeAdjustment, query);
scaleGuideVolume(volumeRangeAdjustment, query);

const startTime = calcStartTime(
phrase.notes,
Expand All @@ -1363,9 +1363,12 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
});
}

// 歌い方をコピーして、ピッチ編集を適用する
// ピッチ編集を適用する前に、歌い方をコピーする

singingGuide = structuredClone(toRaw(singingGuide));

// ピッチ編集を適用する

applyPitchEdit(singingGuide, pitchEditData, editFrameRate);

// 歌声のキャッシュがあれば取得し、なければ音声合成を行う
Expand All @@ -1391,18 +1394,19 @@ export const singingStore = createPartialStore<SingingStoreTypes>({
phrase.notes,
tempos,
tpqn,
keyRangeAdjustment,
0, // クエリのピッチは音域調整済みなので、音域調整の処理(noteのkeyのシフト)は行わない
singingGuide.frameRate,
restDurationSeconds,
);

const volumes = await dispatch("FETCH_SING_FRAME_VOLUME", {
notes: notesForRequestToEngine,
frameAudioQuery: singingGuide.query,
styleId: singingTeacherStyleId,
engineId: singerAndFrameRate.singer.engineId,
});
singingGuide.query.volume = volumes;

// 声量調整を適用する
scaleGuideVolume(volumeRangeAdjustment, singingGuide.query);

const blob = await synthesize(
Expand Down
Loading