diff --git a/src/mock/engineMock/talkModelMock.ts b/src/mock/engineMock/talkModelMock.ts index 427b43b8f3..cce6fc5ce0 100644 --- a/src/mock/engineMock/talkModelMock.ts +++ b/src/mock/engineMock/talkModelMock.ts @@ -19,7 +19,6 @@ async function createOrGetTokenizer() { return new Promise>((resolve, reject) => { // ブラウザのときはCDNから辞書を取得し、Nodeのときはローカルから取得する - console.log(window); const isBrowser = global == undefined; const dicPath = isBrowser ? `https://cdn.jsdelivr.net/npm/kuromoji@${packageJson.devDependencies.kuromoji}/dict` diff --git a/tests/unit/mock/engineMock/__screenshots__/index.browser.spec.ts/mock-synthesisSynthesisPost-1.png b/tests/unit/mock/engineMock/__screenshots__/index.browser.spec.ts/mock-synthesisSynthesisPost-1.png deleted file mode 100644 index f88c55c1ca..0000000000 Binary files a/tests/unit/mock/engineMock/__screenshots__/index.browser.spec.ts/mock-synthesisSynthesisPost-1.png and /dev/null differ diff --git a/tests/unit/mock/engineMock/__snapshots__/index.spec.ts.snap b/tests/unit/mock/engineMock/__snapshots__/index.spec.ts.snap index af23ed8bea..d40c8efe49 100644 --- a/tests/unit/mock/engineMock/__snapshots__/index.spec.ts.snap +++ b/tests/unit/mock/engineMock/__snapshots__/index.spec.ts.snap @@ -61,6 +61,116 @@ exports[`mock > audioQueryAudioQueryPost 1`] = ` } `; +exports[`mock > frameSynthesisFrameSynthesisPost 1`] = `"6f4e9484167d90b681365f9bd81a4cc55ec4e77d078943b4d2381e4f0940ed61"`; + +exports[`mock > singFrameAudioQuerySingFrameAudioQueryPost 1`] = ` +{ + "f0": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 46.17422889791779, + 46.08055781881967, + 46.08055781881967, + 46.16797823967303, + 46.18048040243588, + 46.18048040243588, + 82.27312267254713, + 82.21745071316357, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + ], + "outputSamplingRate": 24000, + "outputStereo": false, + "phonemes": [ + { + "frameLength": 9, + "noteId": "a", + "phoneme": "pau", + }, + { + "frameLength": 1, + "noteId": "b", + "phoneme": "t", + }, + { + "frameLength": 2, + "noteId": "b", + "phoneme": "e", + }, + { + "frameLength": 1, + "noteId": "c", + "phoneme": "s", + }, + { + "frameLength": 2, + "noteId": "c", + "phoneme": "u", + }, + { + "frameLength": 1, + "noteId": "d", + "phoneme": "t", + }, + { + "frameLength": 1, + "noteId": "d", + "phoneme": "o", + }, + { + "frameLength": 10, + "noteId": "e", + "phoneme": "pau", + }, + ], + "volume": [ + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7732211475542967, + 0.7702900494608796, + 0.7702900494608796, + 0.7730257409255916, + 0.7734165541957456, + 0.7734165541957456, + 0.7737647610411076, + 0.7727873601766926, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + 0.7635414345273557, + ], + "volumeScale": 1, +} +`; + exports[`mock > synthesisSynthesisPost 1`] = `"680a0b3cb0e937d56e3f99304de0d352599439502443bae11828bf875be13bc4"`; exports[`mock > versionVersionGet 1`] = `"mock"`; diff --git a/tests/unit/mock/engineMock/index.spec.ts b/tests/unit/mock/engineMock/index.spec.ts index 817d0e1b69..8d72ab1036 100644 --- a/tests/unit/mock/engineMock/index.spec.ts +++ b/tests/unit/mock/engineMock/index.spec.ts @@ -28,4 +28,41 @@ describe("mock", () => { }); expect(await hash(await response.arrayBuffer())).toMatchSnapshot(); }); + + it("singFrameAudioQuerySingFrameAudioQueryPost", async () => { + const response = await mock.singFrameAudioQuerySingFrameAudioQueryPost({ + speaker: 0, + score: { + notes: [ + { id: "a", key: undefined, frameLength: 10, lyric: "" }, + { id: "b", key: 30, frameLength: 3, lyric: "て" }, + { id: "c", key: 30, frameLength: 3, lyric: "す" }, + { id: "d", key: 40, frameLength: 1, lyric: "と" }, + { id: "e", key: undefined, frameLength: 10, lyric: "" }, + ], + }, + }); + expect(response).toMatchSnapshot(); + }); + + it("frameSynthesisFrameSynthesisPost", async () => { + const frameAudioQuery = + await mock.singFrameAudioQuerySingFrameAudioQueryPost({ + speaker: 0, + score: { + notes: [ + { id: "a", key: undefined, frameLength: 10, lyric: "" }, + { id: "b", key: 30, frameLength: 3, lyric: "て" }, + { id: "c", key: 30, frameLength: 3, lyric: "す" }, + { id: "d", key: 40, frameLength: 1, lyric: "と" }, + { id: "e", key: undefined, frameLength: 10, lyric: "" }, + ], + }, + }); + const response = await mock.frameSynthesisFrameSynthesisPost({ + frameAudioQuery, + speaker: 0, + }); + expect(await hash(await response.arrayBuffer())).toMatchSnapshot(); + }); });