@lokutor/sdk 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
- package/src/client.ts +4 -4
package/dist/index.js
CHANGED
|
@@ -1318,7 +1318,7 @@ var TTSClient = class {
|
|
|
1318
1318
|
const req = {
|
|
1319
1319
|
text: options.text,
|
|
1320
1320
|
voice: options.voice || "F1" /* F1 */,
|
|
1321
|
-
|
|
1321
|
+
language: options.language || "en" /* ENGLISH */,
|
|
1322
1322
|
speed: options.speed || 1.05,
|
|
1323
1323
|
steps: options.steps || 24,
|
|
1324
1324
|
visemes: options.visemes || false
|
|
@@ -1407,7 +1407,7 @@ var STTClient = class {
|
|
|
1407
1407
|
if (typeof Blob !== "undefined" && options.audio instanceof Blob) {
|
|
1408
1408
|
const form = new FormData();
|
|
1409
1409
|
form.append("audio", options.audio, "audio.wav");
|
|
1410
|
-
if (options.language) form.append("
|
|
1410
|
+
if (options.language) form.append("language", options.language);
|
|
1411
1411
|
if (options.sampleRate) form.append("sample_rate", String(options.sampleRate));
|
|
1412
1412
|
res = await fetch(url, {
|
|
1413
1413
|
method: "POST",
|
|
@@ -1423,7 +1423,7 @@ var STTClient = class {
|
|
|
1423
1423
|
audio: uint8ArrayToBase64(bytes),
|
|
1424
1424
|
format: options.format || "pcm16",
|
|
1425
1425
|
sample_rate: options.sampleRate,
|
|
1426
|
-
|
|
1426
|
+
language: options.language
|
|
1427
1427
|
})
|
|
1428
1428
|
});
|
|
1429
1429
|
}
|
|
@@ -1495,7 +1495,7 @@ var SpeechToTextClient = class {
|
|
|
1495
1495
|
this.ws.onopen = async () => {
|
|
1496
1496
|
this.isConnected = true;
|
|
1497
1497
|
this.onStatusChange?.("connected");
|
|
1498
|
-
this.ws.send(JSON.stringify({
|
|
1498
|
+
this.ws.send(JSON.stringify({ language: this.language || "en" /* ENGLISH */, vad: this.vad }));
|
|
1499
1499
|
await this.audioManager.startMicrophone((data) => {
|
|
1500
1500
|
if (this.isConnected && this.ws?.readyState === WebSocket.OPEN) {
|
|
1501
1501
|
this.ws.send(data);
|
package/dist/index.mjs
CHANGED
|
@@ -1267,7 +1267,7 @@ var TTSClient = class {
|
|
|
1267
1267
|
const req = {
|
|
1268
1268
|
text: options.text,
|
|
1269
1269
|
voice: options.voice || "F1" /* F1 */,
|
|
1270
|
-
|
|
1270
|
+
language: options.language || "en" /* ENGLISH */,
|
|
1271
1271
|
speed: options.speed || 1.05,
|
|
1272
1272
|
steps: options.steps || 24,
|
|
1273
1273
|
visemes: options.visemes || false
|
|
@@ -1356,7 +1356,7 @@ var STTClient = class {
|
|
|
1356
1356
|
if (typeof Blob !== "undefined" && options.audio instanceof Blob) {
|
|
1357
1357
|
const form = new FormData();
|
|
1358
1358
|
form.append("audio", options.audio, "audio.wav");
|
|
1359
|
-
if (options.language) form.append("
|
|
1359
|
+
if (options.language) form.append("language", options.language);
|
|
1360
1360
|
if (options.sampleRate) form.append("sample_rate", String(options.sampleRate));
|
|
1361
1361
|
res = await fetch(url, {
|
|
1362
1362
|
method: "POST",
|
|
@@ -1372,7 +1372,7 @@ var STTClient = class {
|
|
|
1372
1372
|
audio: uint8ArrayToBase64(bytes),
|
|
1373
1373
|
format: options.format || "pcm16",
|
|
1374
1374
|
sample_rate: options.sampleRate,
|
|
1375
|
-
|
|
1375
|
+
language: options.language
|
|
1376
1376
|
})
|
|
1377
1377
|
});
|
|
1378
1378
|
}
|
|
@@ -1444,7 +1444,7 @@ var SpeechToTextClient = class {
|
|
|
1444
1444
|
this.ws.onopen = async () => {
|
|
1445
1445
|
this.isConnected = true;
|
|
1446
1446
|
this.onStatusChange?.("connected");
|
|
1447
|
-
this.ws.send(JSON.stringify({
|
|
1447
|
+
this.ws.send(JSON.stringify({ language: this.language || "en" /* ENGLISH */, vad: this.vad }));
|
|
1448
1448
|
await this.audioManager.startMicrophone((data) => {
|
|
1449
1449
|
if (this.isConnected && this.ws?.readyState === WebSocket.OPEN) {
|
|
1450
1450
|
this.ws.send(data);
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -893,7 +893,7 @@ export class TTSClient {
|
|
|
893
893
|
const req = {
|
|
894
894
|
text: options.text,
|
|
895
895
|
voice: options.voice || VoiceStyle.F1,
|
|
896
|
-
|
|
896
|
+
language: options.language || Language.ENGLISH,
|
|
897
897
|
speed: options.speed || 1.05,
|
|
898
898
|
steps: options.steps || 24,
|
|
899
899
|
visemes: options.visemes || false
|
|
@@ -1001,7 +1001,7 @@ export class STTClient {
|
|
|
1001
1001
|
if (typeof Blob !== 'undefined' && options.audio instanceof Blob) {
|
|
1002
1002
|
const form = new FormData();
|
|
1003
1003
|
form.append('audio', options.audio, 'audio.wav');
|
|
1004
|
-
if (options.language) form.append('
|
|
1004
|
+
if (options.language) form.append('language', options.language);
|
|
1005
1005
|
if (options.sampleRate) form.append('sample_rate', String(options.sampleRate));
|
|
1006
1006
|
res = await fetch(url, {
|
|
1007
1007
|
method: 'POST',
|
|
@@ -1019,7 +1019,7 @@ export class STTClient {
|
|
|
1019
1019
|
audio: uint8ArrayToBase64(bytes),
|
|
1020
1020
|
format: options.format || 'pcm16',
|
|
1021
1021
|
sample_rate: options.sampleRate,
|
|
1022
|
-
|
|
1022
|
+
language: options.language,
|
|
1023
1023
|
}),
|
|
1024
1024
|
});
|
|
1025
1025
|
}
|
|
@@ -1105,7 +1105,7 @@ export class SpeechToTextClient {
|
|
|
1105
1105
|
this.ws.onopen = async () => {
|
|
1106
1106
|
this.isConnected = true;
|
|
1107
1107
|
this.onStatusChange?.('connected');
|
|
1108
|
-
this.ws!.send(JSON.stringify({
|
|
1108
|
+
this.ws!.send(JSON.stringify({ language: this.language || Language.ENGLISH, vad: this.vad }));
|
|
1109
1109
|
|
|
1110
1110
|
await this.audioManager!.startMicrophone((data) => {
|
|
1111
1111
|
if (this.isConnected && this.ws?.readyState === WebSocket.OPEN) {
|