@@ -22,22 +22,22 @@ import { DictMock } from "./dictMock";
22
22
import { cloneWithUnwrapProxy } from "@/helpers/cloneWithUnwrapProxy" ;
23
23
import {
24
24
AccentPhrase ,
25
- AccentPhrasesAccentPhrasesPostRequest ,
25
+ AccentPhrasesRequest ,
26
26
AudioQuery ,
27
- AudioQueryAudioQueryPostRequest ,
27
+ AudioQueryRequest ,
28
28
DefaultApiInterface ,
29
29
EngineManifest ,
30
30
FrameAudioQuery ,
31
- FrameSynthesisFrameSynthesisPostRequest ,
32
- MoraDataMoraDataPostRequest ,
33
- SingerInfoSingerInfoGetRequest ,
34
- SingFrameAudioQuerySingFrameAudioQueryPostRequest ,
35
- SingFrameVolumeSingFrameVolumePostRequest ,
31
+ FrameSynthesisRequest ,
32
+ MoraDataRequest ,
33
+ SingerInfoRequest ,
34
+ SingFrameAudioQueryRequest ,
35
+ SingFrameVolumeRequest ,
36
36
Speaker ,
37
37
SpeakerInfo ,
38
- SpeakerInfoSpeakerInfoGetRequest ,
38
+ SpeakerInfoRequest ,
39
39
SupportedDevicesInfo ,
40
- SynthesisSynthesisPostRequest ,
40
+ SynthesisRequest ,
41
41
} from "@/openapi" ;
42
42
43
43
/**
@@ -48,52 +48,46 @@ export function createOpenAPIEngineMock(): DefaultApiInterface {
48
48
const dictMock = new DictMock ( ) ;
49
49
50
50
const mockApi : Partial < DefaultApiInterface > = {
51
- async versionVersionGet ( ) : Promise < string > {
51
+ async version ( ) : Promise < string > {
52
52
return "mock" ;
53
53
} ,
54
54
55
55
// メタ情報
56
- async engineManifestEngineManifestGet ( ) : Promise < EngineManifest > {
56
+ async engineManifest ( ) : Promise < EngineManifest > {
57
57
return getEngineManifestMock ( ) ;
58
58
} ,
59
59
60
- async supportedDevicesSupportedDevicesGet ( ) : Promise < SupportedDevicesInfo > {
60
+ async supportedDevices ( ) : Promise < SupportedDevicesInfo > {
61
61
return { cpu : true , cuda : false , dml : false } ;
62
62
} ,
63
63
64
64
// キャラクター情報
65
- async isInitializedSpeakerIsInitializedSpeakerGet ( ) : Promise < boolean > {
65
+ async isInitializedSpeaker ( ) : Promise < boolean > {
66
66
return true ;
67
67
} ,
68
68
69
- async initializeSpeakerInitializeSpeakerPost ( ) : Promise < void > {
69
+ async initializeSpeaker ( ) : Promise < void > {
70
70
return ;
71
71
} ,
72
72
73
- async speakersSpeakersGet ( ) : Promise < Speaker [ ] > {
73
+ async speakers ( ) : Promise < Speaker [ ] > {
74
74
return getSpeakersMock ( ) ;
75
75
} ,
76
76
77
- async speakerInfoSpeakerInfoGet (
78
- payload : SpeakerInfoSpeakerInfoGetRequest ,
79
- ) : Promise < SpeakerInfo > {
77
+ async speakerInfo ( payload : SpeakerInfoRequest ) : Promise < SpeakerInfo > {
80
78
return getSpeakerInfoMock ( payload . speakerUuid ) ;
81
79
} ,
82
80
83
- async singersSingersGet ( ) : Promise < Speaker [ ] > {
81
+ async singers ( ) : Promise < Speaker [ ] > {
84
82
return getSingersMock ( ) ;
85
83
} ,
86
84
87
- async singerInfoSingerInfoGet (
88
- paload : SingerInfoSingerInfoGetRequest ,
89
- ) : Promise < SpeakerInfo > {
90
- return getSpeakerInfoMock ( paload . speakerUuid ) ;
85
+ async singerInfo ( payload : SingerInfoRequest ) : Promise < SpeakerInfo > {
86
+ return getSpeakerInfoMock ( payload . speakerUuid ) ;
91
87
} ,
92
88
93
89
// トーク系
94
- async audioQueryAudioQueryPost (
95
- payload : AudioQueryAudioQueryPostRequest ,
96
- ) : Promise < AudioQuery > {
90
+ async audioQuery ( payload : AudioQueryRequest ) : Promise < AudioQuery > {
97
91
const accentPhrases = await textToActtentPhrasesMock (
98
92
dictMock . applyDict ( payload . text ) ,
99
93
payload . speaker ,
@@ -112,8 +106,8 @@ export function createOpenAPIEngineMock(): DefaultApiInterface {
112
106
} ;
113
107
} ,
114
108
115
- async accentPhrasesAccentPhrasesPost (
116
- payload : AccentPhrasesAccentPhrasesPostRequest ,
109
+ async accentPhrases (
110
+ payload : AccentPhrasesRequest ,
117
111
) : Promise < AccentPhrase [ ] > {
118
112
let accentPhrases : AccentPhrase [ ] ;
119
113
if ( payload . isKana ) {
@@ -130,18 +124,14 @@ export function createOpenAPIEngineMock(): DefaultApiInterface {
130
124
return accentPhrases ;
131
125
} ,
132
126
133
- async moraDataMoraDataPost (
134
- payload : MoraDataMoraDataPostRequest ,
135
- ) : Promise < AccentPhrase [ ] > {
127
+ async moraData ( payload : MoraDataRequest ) : Promise < AccentPhrase [ ] > {
136
128
const accentPhrase = cloneWithUnwrapProxy ( payload . accentPhrase ) ;
137
129
replaceLengthMock ( accentPhrase , payload . speaker ) ;
138
130
replacePitchMock ( accentPhrase , payload . speaker ) ;
139
131
return accentPhrase ;
140
132
} ,
141
133
142
- async synthesisSynthesisPost (
143
- payload : SynthesisSynthesisPostRequest ,
144
- ) : Promise < Blob > {
134
+ async synthesis ( payload : SynthesisRequest ) : Promise < Blob > {
145
135
const frameAudioQuery = audioQueryToFrameAudioQueryMock (
146
136
payload . audioQuery ,
147
137
{
@@ -157,8 +147,8 @@ export function createOpenAPIEngineMock(): DefaultApiInterface {
157
147
} ,
158
148
159
149
// ソング系
160
- async singFrameAudioQuerySingFrameAudioQueryPost (
161
- payload : SingFrameAudioQuerySingFrameAudioQueryPostRequest ,
150
+ async singFrameAudioQuery (
151
+ payload : SingFrameAudioQueryRequest ,
162
152
) : Promise < FrameAudioQuery > {
163
153
const { score, speaker : styleId } = cloneWithUnwrapProxy ( payload ) ;
164
154
@@ -185,8 +175,8 @@ export function createOpenAPIEngineMock(): DefaultApiInterface {
185
175
} ;
186
176
} ,
187
177
188
- async singFrameVolumeSingFrameVolumePost (
189
- payload : SingFrameVolumeSingFrameVolumePostRequest ,
178
+ async singFrameVolume (
179
+ payload : SingFrameVolumeRequest ,
190
180
) : Promise < Array < number > > {
191
181
const {
192
182
speaker : styleId ,
@@ -202,9 +192,7 @@ export function createOpenAPIEngineMock(): DefaultApiInterface {
202
192
return volume ;
203
193
} ,
204
194
205
- async frameSynthesisFrameSynthesisPost (
206
- payload : FrameSynthesisFrameSynthesisPostRequest ,
207
- ) : Promise < Blob > {
195
+ async frameSynthesis ( payload : FrameSynthesisRequest ) : Promise < Blob > {
208
196
const { speaker : styleId , frameAudioQuery } =
209
197
cloneWithUnwrapProxy ( payload ) ;
210
198
const buffer = synthesisFrameAudioQueryMock ( frameAudioQuery , styleId ) ;
0 commit comments