Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

色々 #19

Merged
merged 12 commits into from
Jun 8, 2023
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voicevox-client",
"version": "0.1.0",
"version": "0.1.1",
"description": "Voicevox wrapper for ts/js",
"main": "dist/index.js",
"exports": {
Expand All @@ -18,9 +18,9 @@
"devDependencies": {
"prettier": "^2.8.6",
"ts-node": "^10.9.1",
"typedoc": "^0.23.28",
"typedoc": "^0.24.8",
"typescript": "^5.0.2",
"@types/node": "^18.15.10",
"@types/node": "^20.2.5",
"voicevox-client": "file:./"
},
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/audio_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ export class audioQuery {
*/
async synthesis(
speaker: number,
options: {
options?: {
interrogative_upspeak?: boolean;
core_version?: string;
}
): Promise<ArrayBuffer> {
options ??= {};
let params: synthesisParams = {
speaker: speaker,
};
Expand Down
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ export class Client {
async createAudioQuery(
text: string,
speaker: number,
options: {
options?: {
core_version?: string;
}
): Promise<audioQuery> {
options ??= {};
let audioquery = await this.rest.createAudioQuery(text, speaker, options);
return new audioQuery(this.rest, audioquery);
}
Expand Down
7 changes: 3 additions & 4 deletions tests/basic.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import Client from "voicevox-client";
import Client from "../dist";
import { promises as fs } from "fs";

const client = new Client("http://127.0.0.1:50021");

async function main() {
const audioQuery = await client.createAudioQuery("こんにちは", 0, {});
const data = await audioQuery.synthesis(0);
await fs.writeFile('sample.wav', data);
const audioQuery = await client.createAudioQuery("こんにちは", 0);
await audioQuery.synthesis(0);
}

main();
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e"
integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==

"@types/node@^18.15.10":
version "18.15.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f"
integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==
"@types/node@^20.2.5":
version "20.2.5"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.2.5.tgz#26d295f3570323b2837d322180dfbf1ba156fefb"
integrity sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==

acorn-walk@^8.1.1:
version "8.2.0"
Expand Down Expand Up @@ -109,15 +109,15 @@ make-error@^1.1.1:
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==

marked@^4.2.12:
marked@^4.3.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3"
integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==

minimatch@^7.1.3:
version "7.4.3"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.3.tgz#012cbf110a65134bb354ae9773b55256cdb045a2"
integrity sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==
minimatch@^9.0.0:
version "9.0.1"
resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.1.tgz#8a555f541cf976c622daf078bb28f29fb927c253"
integrity sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==
dependencies:
brace-expansion "^2.0.1"

Expand Down Expand Up @@ -155,14 +155,14 @@ ts-node@^10.9.1:
v8-compile-cache-lib "^3.0.1"
yn "3.1.1"

typedoc@^0.23.28:
version "0.23.28"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.23.28.tgz#3ce9c36ef1c273fa849d2dea18651855100d3ccd"
integrity sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==
typedoc@^0.24.8:
version "0.24.8"
resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.24.8.tgz#cce9f47ba6a8d52389f5e583716a2b3b4335b63e"
integrity sha512-ahJ6Cpcvxwaxfu4KtjA8qZNqS43wYt6JL27wYiIgl1vd38WW/KWX11YuAeZhuz9v+ttrutSsgK+XO1CjL1kA3w==
dependencies:
lunr "^2.3.9"
marked "^4.2.12"
minimatch "^7.1.3"
marked "^4.3.0"
minimatch "^9.0.0"
shiki "^0.14.1"

typescript@^5.0.2:
Expand All @@ -176,7 +176,7 @@ v8-compile-cache-lib@^3.0.1:
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==

"voicevox-client@file:.":
version "0.1.0"
version "0.1.1"

vscode-oniguruma@^1.7.0:
version "1.7.0"
Expand Down