Skip to content

Commit

Permalink
FIX: MorphingInfo型からundefinedを除去
Browse files Browse the repository at this point in the history
  • Loading branch information
sabonerune committed Dec 5, 2022
1 parent a35afc6 commit ce49463
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/store/audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ export const audioStore = createPartialStore<AudioStoreTypes>({
{
audioKey,
morphingInfo,
}: { audioKey: string; morphingInfo: MorphingInfo }
}: { audioKey: string; morphingInfo: MorphingInfo | undefined }
) {
const item = state.audioItems[audioKey];
item.morphingInfo = morphingInfo;
Expand Down Expand Up @@ -2505,7 +2505,7 @@ export const audioCommandStore = transformCommandStore(
draft,
payload: {
audioKey: string;
morphingInfo: MorphingInfo;
morphingInfo: MorphingInfo | undefined;
}
) {
audioStore.mutations.SET_MORPHING_INFO(draft, payload);
Expand All @@ -2514,7 +2514,7 @@ export const audioCommandStore = transformCommandStore(
{ commit },
payload: {
audioKey: string;
morphingInfo: MorphingInfo;
morphingInfo: MorphingInfo | undefined;
}
) {
commit("COMMAND_SET_MORPHING_INFO", payload);
Expand Down
9 changes: 6 additions & 3 deletions src/store/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export type AudioStoreTypes = {
SET_MORPHING_INFO: {
mutation: {
audioKey: string;
morphingInfo: MorphingInfo;
morphingInfo: MorphingInfo | undefined;
};
};

Expand Down Expand Up @@ -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: {
Expand Down
15 changes: 7 additions & 8 deletions src/type/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, Preset>;
Expand Down

0 comments on commit ce49463

Please sign in to comment.