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;