From ce49463e165292098974a7bd056bfd58eef6fb23 Mon Sep 17 00:00:00 2001 From: sabonerune <102559104+sabonerune@users.noreply.github.com> Date: Mon, 5 Dec 2022 18:51:25 +0900 Subject: [PATCH] =?UTF-8?q?FIX:=20MorphingInfo=E5=9E=8B=E3=81=8B=E3=82=89u?= =?UTF-8?q?ndefined=E3=82=92=E9=99=A4=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/audio.ts | 6 +++--- src/store/type.ts | 9 ++++++--- src/type/preload.ts | 15 +++++++-------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/store/audio.ts b/src/store/audio.ts index 781f2f28ca..648966448c 100644 --- a/src/store/audio.ts +++ b/src/store/audio.ts @@ -684,7 +684,7 @@ export const audioStore = createPartialStore({ { audioKey, morphingInfo, - }: { audioKey: string; morphingInfo: MorphingInfo } + }: { audioKey: string; morphingInfo: MorphingInfo | undefined } ) { const item = state.audioItems[audioKey]; item.morphingInfo = morphingInfo; @@ -2505,7 +2505,7 @@ export const audioCommandStore = transformCommandStore( draft, payload: { audioKey: string; - morphingInfo: MorphingInfo; + morphingInfo: MorphingInfo | undefined; } ) { audioStore.mutations.SET_MORPHING_INFO(draft, payload); @@ -2514,7 +2514,7 @@ export const audioCommandStore = transformCommandStore( { commit }, payload: { audioKey: string; - morphingInfo: MorphingInfo; + morphingInfo: MorphingInfo | undefined; } ) { commit("COMMAND_SET_MORPHING_INFO", payload); diff --git a/src/store/type.ts b/src/store/type.ts index be8aa36c44..cce4b199f1 100644 --- a/src/store/type.ts +++ b/src/store/type.ts @@ -269,7 +269,7 @@ export type AudioStoreTypes = { SET_MORPHING_INFO: { mutation: { audioKey: string; - morphingInfo: MorphingInfo; + morphingInfo: MorphingInfo | undefined; }; }; @@ -588,9 +588,12 @@ export type AudioCommandStoreTypes = { COMMAND_SET_MORPHING_INFO: { mutation: { audioKey: string; - morphingInfo: MorphingInfo; + morphingInfo: MorphingInfo | undefined; }; - action(payload: { audioKey: string; morphingInfo: MorphingInfo }): void; + action(payload: { + audioKey: string; + morphingInfo: MorphingInfo | undefined; + }): void; }; COMMAND_SET_AUDIO_PRESET: { diff --git a/src/type/preload.ts b/src/type/preload.ts index e569103e66..68bfeb2b18 100644 --- a/src/type/preload.ts +++ b/src/type/preload.ts @@ -203,16 +203,15 @@ export type Preset = { volumeScale: number; prePhonemeLength: number; postPhonemeLength: number; + morphingInfo?: MorphingInfo; }; -export type MorphingInfo = - | { - rate: number; - targetEngineId: string; - targetSpeakerId: string; - targetStyleId: number; - } - | undefined; +export type MorphingInfo = { + rate: number; + targetEngineId: string; + targetSpeakerId: string; + targetStyleId: number; +}; export type PresetConfig = { items: Record;