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

新規:プリセット[pauseLength, pauseLengthScale] #2100

Closed
wants to merge 93 commits into from
Closed
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
52360e8
設定での操作と右欄初期化&設定反映まで
X-20A May 25, 2024
a5db9d2
新規:プリセット[pauseLength, pauseLengthScale]
X-20A May 26, 2024
25da5ca
マニュアル値の設定に対応
X-20A May 28, 2024
1f22f56
Add files via upload
X-20A May 28, 2024
81079ee
pauseLengthScaleを複数回操作すると反映されないバグを修正
X-20A May 28, 2024
0ccb1e3
Delete env.test
X-20A May 28, 2024
5fc13cd
Delete env.production
X-20A May 28, 2024
84df131
pauseLengthScaleを複数回操作すると反映されないバグを修正
X-20A May 28, 2024
115007a
Merge branch 'add_preset' of https://github.com/X-20A/voicevox into a…
X-20A May 28, 2024
5ca3eca
片付け
X-20A Jun 1, 2024
e66efe6
片付け
X-20A Jun 1, 2024
3a56962
プリセット名変更 他整理
X-20A Jun 7, 2024
bb35b17
プリセット名変更 他整理
X-20A Jun 7, 2024
7a3394a
プリセット名変更 他整理
X-20A Jun 7, 2024
3842b38
プリセット名変更 他整理
X-20A Jun 7, 2024
cc7f005
プリセット名変更 他整理
X-20A Jun 7, 2024
cd9ae32
Rename env.test to .env.test
X-20A Jun 7, 2024
abc324d
Rename env.production to .env.production
X-20A Jun 7, 2024
696d5ad
test
X-20A Jun 7, 2024
b6c03e6
test
X-20A Jun 7, 2024
7bfd6ad
UIを変更 [update snapshots]
X-20A Jun 7, 2024
4f81085
UIを変更 [update snapshots]
X-20A Jun 7, 2024
715c067
UIを変更 [update snapshots]
X-20A Jun 7, 2024
0786b1c
UIを変更 [update snapshots]
X-20A Jun 7, 2024
9926732
UIを変更 [update snapshots]
X-20A Jun 7, 2024
523ef78
UIを変更 [update snapshots]
X-20A Jun 7, 2024
e0e59f4
UIを変更 [update snapshots]
X-20A Jun 7, 2024
fe06cba
UIを変更 [update snapshots]
X-20A Jun 7, 2024
aed0602
UIを変更 [update snapshots]
X-20A Jun 7, 2024
c59b4f3
(スナップショットを更新)
github-actions[bot] Jun 7, 2024
264da6b
UIを変更 [update snapshots]
X-20A Jun 7, 2024
38f5430
UIを変更 [update snapshots]
X-20A Jun 7, 2024
e699611
UIを変更 [update snapshots]
X-20A Jun 7, 2024
9f23e30
UIを変更 [update snapshots]
X-20A Jun 7, 2024
59d2f7c
(スナップショットを更新)
github-actions[bot] Jun 7, 2024
f846af1
UIを変更 [update snapshots]
X-20A Jun 7, 2024
a6c95ce
Merge branch 'add_preset' of https://github.com/X-20A/voicevox into a…
X-20A Jun 7, 2024
2e967a3
test
X-20A Jun 12, 2024
515116f
merge branch 'dev' of https://github.com/X-20A/voicevox into dev
X-20A Jun 12, 2024
990973b
test
X-20A Jun 12, 2024
c5a4c55
UIを変更 [update snapshots]
X-20A Jun 12, 2024
84b4209
UIを変更 [update snapshots]
X-20A Jun 12, 2024
598ce69
test
X-20A Jun 13, 2024
e7b4541
test
X-20A Jun 13, 2024
0041172
UIを変更 [update snapshots]
X-20A Jun 13, 2024
c87c22d
test
X-20A Jun 13, 2024
c8a987d
test
X-20A Jun 13, 2024
76c7bd4
UIを変更 [update snapshots]
X-20A Jun 13, 2024
a53c299
test
X-20A Jun 13, 2024
445b702
UIを変更 [update snapshots]
X-20A Jun 13, 2024
27cb55c
UIを変更 [update snapshots]
X-20A Jun 13, 2024
1537bc3
UIを変更 [update snapshots]
X-20A Jun 13, 2024
e27d557
UIを変更 [update snapshots]
X-20A Jun 13, 2024
bc69a78
UIを変更 [update snapshots]
X-20A Jun 13, 2024
96b8278
整理 [update snapshots]
X-20A Jun 13, 2024
586f410
整理 [update snapshots]
X-20A Jun 14, 2024
f18a863
整理 [update snapshots]
X-20A Jun 14, 2024
90d5e56
整理 [update snapshots]
X-20A Jun 14, 2024
43be8ed
整理 [update snapshots]
X-20A Jun 14, 2024
6c106d6
整理 [update snapshots]
X-20A Jun 14, 2024
ca60f56
整理 [update snapshots]
X-20A Jun 14, 2024
fd63cc0
整理 [update snapshots]
X-20A Jun 14, 2024
d5a5952
整理 [update snapshots]
X-20A Jun 14, 2024
e207c11
整理 [update snapshots]
X-20A Jun 14, 2024
2b1201d
整理 [update snapshots]
X-20A Jun 14, 2024
2d20917
UIを変更 [update snapshots]
X-20A Jun 14, 2024
e57687b
UIを変更 [update snapshots]
X-20A Jun 14, 2024
52dda5a
UIを変更 [update snapshots]
X-20A Jun 14, 2024
a3b6ef5
整理 [update snapshots]
X-20A Jun 14, 2024
56d109c
UIを変更 [update snapshots]
X-20A Jun 14, 2024
cb963d4
UIを変更 [update snapshots]
X-20A Jun 14, 2024
cb5f6c6
UIを変更 [update snapshots]
X-20A Jun 14, 2024
10c7a3c
(スナップショットを更新)
github-actions[bot] Jun 14, 2024
98293b6
片付け [update snapshots]
X-20A Jun 14, 2024
6762db5
片付け
X-20A Jun 14, 2024
74f826a
片付け
X-20A Jun 14, 2024
ada5dc4
片付け
X-20A Jun 14, 2024
84fbefa
片付け
X-20A Jun 14, 2024
33bb684
片付け
X-20A Jun 14, 2024
4db5140
片付け
X-20A Jun 14, 2024
242677a
片付け
X-20A Jun 15, 2024
6e4c6e3
片付け
X-20A Jun 15, 2024
a85cb38
文内無音のdisableにadjustPauseLengthフラグを使用
X-20A Jun 26, 2024
2682b4f
文内無音のdisableにadjustPauseLengthフラグを使用
X-20A Jun 26, 2024
2e0c70f
文内無音のdisableにadjustPauseLengthフラグを使用
X-20A Jun 26, 2024
6ec65fc
UIを変更 [update snapshots]
X-20A Jun 26, 2024
e2b9d72
UIを変更 [update snapshots]
X-20A Jun 26, 2024
2d5b436
Delete tests/e2e/browser/スクリーンショット.spec.ts-snapshots/メイン画面-browser-wi…
X-20A Jun 26, 2024
014fc97
UIを変更 [update snapshots]
X-20A Jun 26, 2024
c3e16f3
UIを変更 [update snapshots]
X-20A Jun 26, 2024
325040a
Merge branch 'add_preset' of https://github.com/X-20A/voicevox into a…
X-20A Jun 26, 2024
3f46576
UIを変更 [update snapshots]
X-20A Jun 26, 2024
03b86bf
(スナップショットを更新)
github-actions[bot] Jun 26, 2024
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
2 changes: 1 addition & 1 deletion openapi.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/components/Dialog/EngineManageDialog.vue
Original file line number Diff line number Diff line change
@@ -461,6 +461,7 @@ const getFeatureName = (name: keyof SupportedFeatures) => {
adjustPitchScale: "全体の音高の調整",
adjustIntonationScale: "全体の抑揚の調整",
adjustVolumeScale: "全体の音量の調整",
adjustPauseLength: "句読点などの無音時間の調整",
interrogativeUpspeak: "疑問文の自動調整",
synthesisMorphing: "2種類のスタイルでモーフィングした音声を合成",
sing: "歌唱音声合成",
88 changes: 87 additions & 1 deletion src/components/Dialog/SettingDialog.vue
Original file line number Diff line number Diff line change
@@ -184,6 +184,51 @@
</QCardActions>
</div>
</QSlideTransition>
<QCardActions class="q-px-md bg-surface">
<div>無音時間の指定方法</div>
<div aria-label="無音時間を一括指定する際のモードを選べます。">
<QIcon name="help_outline" size="sm" class="help-hover-icon">
<QTooltip
:delay="500"
anchor="center right"
self="center left"
transition-show="jump-right"
transition-hide="jump-left"
>
無音時間を一括指定する際のモードを選べます。
</QTooltip>
</QIcon>
</div>
<QSpace />
<QBtnToggle
v-model="pauseLengthMode"
padding="xs md"
unelevated
color="background"
text-color="display"
toggle-color="primary"
toggle-text-color="display-on-primary"
:options="[
{
label: '倍率',
value: 'SCALE',
slot: 'SCALE',
},
{
label: '絶対値',
value: 'ABSOLUTE',
slot: 'ABSOLUTE',
},
]"
>
<template #SCALE>
<QTooltip :delay="500">倍率で指定します(n倍)。</QTooltip>
</template>
<template #ABSOLUTE>
<QTooltip :delay="500">絶対値で指定します(n秒)。</QTooltip>
</template>
</QBtnToggle>
</QCardActions>
<QCardActions class="q-px-md bg-surface">
<div>パラメータの引き継ぎ</div>
<div
@@ -1016,14 +1061,15 @@
</template>

<script setup lang="ts">
import { computed, ref, watchEffect } from "vue";
import { computed, ref, watchEffect, watch } from "vue";
import FileNamePatternDialog from "./FileNamePatternDialog.vue";
import { useStore } from "@/store";
import {
isProduction,
SavingSetting,
EngineSettingType,
ExperimentalSettingType,
PauseLengthMode,
ActivePointScrollMode,
RootMiscSettingType,
EngineId,
@@ -1068,6 +1114,46 @@ const engineUseGpu = computed({
});
const engineIds = computed(() => store.state.engineIds);
const engineInfos = computed(() => store.state.engineInfos);

const pauseLengthMode = computed({
get: () => store.state.pauseLengthMode,
set: (pauseLengthMode: PauseLengthMode) => {
store.dispatch("SET_PAUSE_LENGTH_MODE", {
pauseLengthMode,
});
},
});

// 読込時の1回は除外しないと設定を操作した判定になって何もしなくても終了時にダイアログが出てしまう
// 何か他にスマートな方法があればいいけど
let isFirstRun: boolean = true;

watch(
() => pauseLengthMode.value,
() => {
if (isFirstRun) {
isFirstRun = false;
return;
}

const audioKeys = store.state.audioKeys;
if (pauseLengthMode.value === "ABSOLUTE") {
// a. 設定で絶対値モードに変更し、query.pauseLengthにnull以外の値が入っているとき
// 適用範囲: 全てのaudioItem
// COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTHから呼び出し
store.dispatch("COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTH", {
audioKeys: audioKeys,
pauseLength: 0.3,
});
} else {
store.dispatch("COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTH_SCALE", {
audioKeys: audioKeys,
pauseLengthScale: 1,
});
}
},
);

const inheritAudioInfoMode = computed(() => store.state.inheritAudioInfo);
const activePointScrollMode = computed({
get: () => store.state.activePointScrollMode,
25 changes: 23 additions & 2 deletions src/components/Talk/AccentPhrase.vue
Original file line number Diff line number Diff line change
@@ -254,15 +254,20 @@ const contextMenudata = ref<[MenuItemButton]>([
},
]);

let beforeText: string = "";

const pronunciation = computed(() => {
let textString = props.accentPhrase.moras.map((mora) => mora.text).join("");
if (props.accentPhrase.pauseMora) {
textString += "、";
}
beforeText = textString;
return textString;
});

const handleChangePronounce = (newPronunciation: string) => {
const handleChangePronounce = async (newPronunciation: string) => {
const copyBeforeText = beforeText;

let popUntilPause = false;
newPronunciation = newPronunciation
.replace(/,/g, "、")
@@ -278,12 +283,28 @@ const handleChangePronounce = (newPronunciation: string) => {
popUntilPause = true;
}
}
store.dispatch("COMMAND_CHANGE_SINGLE_ACCENT_PHRASE", {
await store.dispatch("COMMAND_CHANGE_SINGLE_ACCENT_PHRASE", {
audioKey: props.audioKey,
newPronunciation,
accentPhraseIndex: props.index,
popUntilPause,
});

// e.AccentPhrasesをfetchしたとき(読み変更で句読点を含めたとき)
// 適用範囲: 現在選択しているAudioItem
if (store.state.pauseLengthMode === "ABSOLUTE") {
// テキストが変更されて、かつ読点が追加されたことを確認
if (!copyBeforeText.includes("、") && newPronunciation.includes("、")) {
const pauseLength =
store.state.audioItems[props.audioKey].query?.pauseLength;
if (pauseLength != null && pauseLength != undefined) {
store.dispatch("COMMAND_MULTI_APPLY_PAUSE_LENGTH", {
audioKeys: [props.audioKey],
pauseLength: pauseLength,
});
}
}
}
};

const hoveredMoraIndex = ref<number | undefined>(undefined);
20 changes: 20 additions & 0 deletions src/components/Talk/AudioCell.vue
Original file line number Diff line number Diff line change
@@ -307,6 +307,9 @@ watch(
);

const pushAudioTextIfNeeded = async (event?: KeyboardEvent) => {
// COMMAND_CHANGE_AUDIO_TEXTでもAccenPhrases弄ってるっぽいのでフラグをコピーして後で処理
const copy_isChangeFlag = isChangeFlag.value;

if (event && event.isComposing) return;
if (!willRemove.value && isChangeFlag.value && !willFocusOrBlur.value) {
isChangeFlag.value = false;
@@ -315,6 +318,23 @@ const pushAudioTextIfNeeded = async (event?: KeyboardEvent) => {
text: audioTextBuffer.value,
});
}

// d.AudioQueryをfetchしたとき(テキスト入力したとき)
// 適用範囲: 現在選択しているAudioItem
// pushAudioTextIfNeededはblurで発火するので、さらにテキストを変更した場合に絞り込む
if (
store.state.pauseLengthMode === "ABSOLUTE" &&
copy_isChangeFlag === true
) {
const pauseLength =
store.state.audioItems[props.audioKey].query?.pauseLength;
if (pauseLength != null && pauseLength != undefined) {
store.dispatch("COMMAND_MULTI_APPLY_PAUSE_LENGTH", {
audioKeys: [props.audioKey],
pauseLength: pauseLength,
});
}
}
};

// バグ修正用
78 changes: 76 additions & 2 deletions src/components/Talk/AudioInfo.vue
Original file line number Diff line number Diff line change
@@ -301,7 +301,7 @@ import { QSelectProps } from "quasar";
import CharacterButton from "@/components/CharacterButton.vue";
import PresetManageDialog from "@/components/Dialog/PresetManageDialog.vue";
import { useStore } from "@/store";

import { AudioItem } from "@/store/type";
import {
AudioKey,
CharacterInfo,
@@ -332,6 +332,9 @@ const uiLocked = computed(() => store.getters.UI_LOCKED);
const audioItem = computed(() => store.state.audioItems[props.activeAudioKey]);
const query = computed(() => audioItem.value?.query);

// 文内無音の指定方式 "SCALE" || "ABSOLUTE"
const pauseLengthMode = computed(() => store.state.pauseLengthMode);

const supportedFeatures = computed(
() =>
(store.state.engineIds.some(
@@ -353,6 +356,8 @@ const selectedAudioKeys = computed(() =>
? store.getters.SELECTED_AUDIO_KEYS
: [props.activeAudioKey],
);

// 句読点などの無音時間はひとまず倍率verを表示 のち必要に応じ絶対値に切替
const parameters = computed<Parameter[]>(() => [
{
label: "話速",
@@ -364,7 +369,6 @@ const parameters = computed<Parameter[]>(() => [
min: SLIDER_PARAMETERS.SPEED.min,
step: SLIDER_PARAMETERS.SPEED.step,
scrollStep: SLIDER_PARAMETERS.SPEED.scrollStep,
scrollMinStep: SLIDER_PARAMETERS.SPEED.scrollMinStep,
onChange: (speedScale: number) =>
store.dispatch("COMMAND_MULTI_SET_AUDIO_SPEED_SCALE", {
audioKeys: selectedAudioKeys.value,
@@ -434,6 +438,51 @@ const parameters = computed<Parameter[]>(() => [
action: "COMMAND_MULTI_SET_AUDIO_VOLUME_SCALE",
key: "volumeScale",
},
// 設定によりどちらかを表示
// b.query.pauseLengthにnull以外の値を代入したとき
pauseLengthMode.value === "SCALE"
? {
label: "文内無音倍率",
slider: previewSliderHelper({
modelValue: () => query.value?.pauseLengthScale ?? null,
disable: () =>
uiLocked.value ||
supportedFeatures.value?.adjustPauseLength === false,
max: SLIDER_PARAMETERS.PAUSE_LENGTH_SCALE.max,
min: SLIDER_PARAMETERS.PAUSE_LENGTH_SCALE.min,
step: SLIDER_PARAMETERS.PAUSE_LENGTH_SCALE.step,
scrollStep: SLIDER_PARAMETERS.PAUSE_LENGTH_SCALE.scrollStep,
scrollMinStep: SLIDER_PARAMETERS.PAUSE_LENGTH_SCALE.scrollMinStep,
onChange: (pauseLengthScale: number) =>
store.dispatch("COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTH_SCALE", {
audioKeys: selectedAudioKeys.value,
pauseLengthScale,
}),
}),
action: "COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTH_SCALE",
key: "pauseLengthScale",
}
: {
label: "文内無音",
slider: previewSliderHelper({
modelValue: () => query.value?.pauseLength ?? 0.3,
disable: () =>
uiLocked.value ||
supportedFeatures.value?.adjustPauseLength === false,
max: SLIDER_PARAMETERS.PAUSE_LENGTH.max,
min: SLIDER_PARAMETERS.PAUSE_LENGTH.min,
step: SLIDER_PARAMETERS.PAUSE_LENGTH.step,
scrollStep: SLIDER_PARAMETERS.PAUSE_LENGTH.scrollStep,
scrollMinStep: SLIDER_PARAMETERS.PAUSE_LENGTH.scrollMinStep,
onChange: (pauseLength: number) =>
store.dispatch("COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTH", {
audioKeys: selectedAudioKeys.value,
pauseLength,
}),
}),
action: "COMMAND_MULTI_SET_AUDIO_PAUSE_LENGTH",
key: "pauseLength",
},
{
label: "開始無音",
slider: previewSliderHelper({
@@ -473,6 +522,7 @@ const parameters = computed<Parameter[]>(() => [
key: "postPhonemeLength",
},
]);

const handleParameterChange = (
parameter: Parameter,
inputValue: string | number | null,
@@ -901,6 +951,30 @@ const updatePreset = async (fullApply: boolean) => {
});

if (fullApply) {
if (store.state.pauseLengthMode === "ABSOLUTE") {
// c.「プリセットの再適用」をしたとき
// 適用範囲: 現在選択しているAudioItemとpresetKeyが同じAudioItem
const audioItems = store.state.audioItems;
const audioKeys: AudioKey[] = Object.keys(
audioItems as Record<string, AudioItem>,
)
.filter((audioKey) => {
const audioItem = audioItems[audioKey as keyof typeof audioItems];
return audioItem.presetKey === key;
})
.map((audioKey) => audioKey as unknown as AudioKey);
const activeAudioItem = audioItems[props.activeAudioKey];
if (activeAudioItem && activeAudioItem.query) {
const pauseLength = activeAudioItem.query.pauseLength;
if (pauseLength != null) {
store.dispatch("COMMAND_MULTI_APPLY_PAUSE_LENGTH", {
audioKeys: audioKeys,
pauseLength: pauseLength,
});
}
}
}

await store.dispatch("COMMAND_FULLY_APPLY_AUDIO_PRESET", {
presetKey: key,
});
2 changes: 2 additions & 0 deletions src/domain/project/schema.ts
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ const audioQuerySchema = z.object({
volumeScale: z.number(),
prePhonemeLength: z.number(),
postPhonemeLength: z.number(),
pauseLength: z.number().nullable(),
pauseLengthScale: z.number(),
outputSamplingRate: z.union([z.number(), z.literal("engineDefault")]),
outputStereo: z.boolean(),
kana: z.string().optional(),
Loading