diff --git a/src/store/audio.ts b/src/store/audio.ts index 52ed4ad0d7..5fb5111730 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; @@ -2535,7 +2535,7 @@ export const audioCommandStore = transformCommandStore( draft, payload: { audioKey: string; - morphingInfo: MorphingInfo; + morphingInfo: MorphingInfo | undefined; } ) { audioStore.mutations.SET_MORPHING_INFO(draft, payload); @@ -2544,7 +2544,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 9d51889a6d..c170b43a51 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; }; }; @@ -590,9 +590,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 01d95c84f7..6f92798cf9 100644 --- a/src/type/preload.ts +++ b/src/type/preload.ts @@ -206,16 +206,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;