@aristech-org/tts-client
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -52,5 +52,9 @@ import * as grpc from '@grpc/grpc-js'; | ||
* Creates an audio buffer from the given text. | ||
* @param request | ||
* @returns | ||
* @param request The request object | ||
* @returns The audio buffer | ||
*/ | ||
synthesize(request: DeepPartial<SpeechRequest>): Promise<Buffer>; | ||
/** | ||
* This is an alias for the `synthesize` method. | ||
*/ | ||
audioBuffer(request: DeepPartial<SpeechRequest>): Promise<Buffer>; | ||
@@ -57,0 +61,0 @@ /** |
@@ -71,6 +71,6 @@ import * as grpc from '@grpc/grpc-js'; | ||
* Creates an audio buffer from the given text. | ||
* @param request | ||
* @returns | ||
* @param request The request object | ||
* @returns The audio buffer | ||
*/ | ||
audioBuffer(request) { | ||
synthesize(request) { | ||
return new Promise(async (res, rej) => { | ||
@@ -80,6 +80,4 @@ const [stream, voice] = await this.streamAudio(request); | ||
stream.on('data', (msg) => { | ||
// if (msg.outputType === 'AUDIO') { | ||
const chunk = Buffer.from(msg.data); | ||
rawChunks.push(chunk); | ||
//} | ||
}); | ||
@@ -106,2 +104,8 @@ stream.on('end', () => { | ||
/** | ||
* This is an alias for the `synthesize` method. | ||
*/ | ||
audioBuffer(request) { | ||
return this.synthesize(request); | ||
} | ||
/** | ||
* Retrieves the phoneset for the given voice. | ||
@@ -108,0 +112,0 @@ * @param request The request object |
{ | ||
"name": "@aristech-org/tts-client", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A Node.js client library for the Aristech Text-to-Speech API", | ||
@@ -37,6 +37,6 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "22.7.8", | ||
"@types/node": "22.7.9", | ||
"dotenv": "^16.4.5", | ||
"simple-git-hooks": "^2.11.1", | ||
"ts-proto": "^2.2.4", | ||
"ts-proto": "2.2.5", | ||
"tsx": "^4.19.1", | ||
@@ -43,0 +43,0 @@ "typescript": "^5.6.3" |
@@ -18,3 +18,3 @@ # Aristech TTS-Client for NodeJS | ||
const client = new TtsClient({ host: 'tts.example.com' }) | ||
const buffer = await client.audioBuffer({ | ||
const buffer = await client.synthesize({ | ||
text: 'Hello, world!', | ||
@@ -21,0 +21,0 @@ options: { voiceId: 'anne_en_GB' }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
93724
2423