@mulingai-npm/redis 3.4.0 → 3.4.2
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/README.md +7 -7
- package/dist/enums/redis-database.d.ts +5 -5
- package/dist/enums/redis-database.js +9 -9
- package/dist/loggers/mulingstream-chunk-logger.d.ts +20 -20
- package/dist/loggers/mulingstream-chunk-logger.js +84 -84
- package/dist/managers/mulingstream-chunk-manager.d.ts +112 -111
- package/dist/managers/mulingstream-chunk-manager.js +359 -352
- package/dist/managers/mulingstream-listener-manager.d.ts +29 -29
- package/dist/managers/mulingstream-listener-manager.js +169 -169
- package/dist/managers/mulingstream-speaker-manager.d.ts +37 -37
- package/dist/managers/mulingstream-speaker-manager.js +225 -225
- package/dist/redis-client.d.ts +44 -44
- package/dist/redis-client.js +143 -143
- package/dist/utils/finders.d.ts +1 -1
- package/dist/utils/finders.js +18 -18
- package/package.json +34 -34
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Redis CLI
|
|
2
|
-
|
|
3
|
-
docker exec -it local-redis redis-cli
|
|
4
|
-
|
|
5
|
-
## choose DB
|
|
6
|
-
|
|
7
|
-
127.0.0.1:6379> SELECT 1
|
|
1
|
+
# Redis CLI
|
|
2
|
+
|
|
3
|
+
docker exec -it local-redis redis-cli
|
|
4
|
+
|
|
5
|
+
## choose DB
|
|
6
|
+
|
|
7
|
+
127.0.0.1:6379> SELECT 1
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare enum RedisDatabase {
|
|
2
|
-
MULINGSTREAM_LISTENER = 0,
|
|
3
|
-
MULINGSTREAM_CHUNK = 1,
|
|
4
|
-
MULINGSTREAM_SPEAKER = 2
|
|
5
|
-
}
|
|
1
|
+
export declare enum RedisDatabase {
|
|
2
|
+
MULINGSTREAM_LISTENER = 0,
|
|
3
|
+
MULINGSTREAM_CHUNK = 1,
|
|
4
|
+
MULINGSTREAM_SPEAKER = 2
|
|
5
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RedisDatabase = void 0;
|
|
4
|
-
var RedisDatabase;
|
|
5
|
-
(function (RedisDatabase) {
|
|
6
|
-
RedisDatabase[RedisDatabase["MULINGSTREAM_LISTENER"] = 0] = "MULINGSTREAM_LISTENER";
|
|
7
|
-
RedisDatabase[RedisDatabase["MULINGSTREAM_CHUNK"] = 1] = "MULINGSTREAM_CHUNK";
|
|
8
|
-
RedisDatabase[RedisDatabase["MULINGSTREAM_SPEAKER"] = 2] = "MULINGSTREAM_SPEAKER";
|
|
9
|
-
})(RedisDatabase = exports.RedisDatabase || (exports.RedisDatabase = {}));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RedisDatabase = void 0;
|
|
4
|
+
var RedisDatabase;
|
|
5
|
+
(function (RedisDatabase) {
|
|
6
|
+
RedisDatabase[RedisDatabase["MULINGSTREAM_LISTENER"] = 0] = "MULINGSTREAM_LISTENER";
|
|
7
|
+
RedisDatabase[RedisDatabase["MULINGSTREAM_CHUNK"] = 1] = "MULINGSTREAM_CHUNK";
|
|
8
|
+
RedisDatabase[RedisDatabase["MULINGSTREAM_SPEAKER"] = 2] = "MULINGSTREAM_SPEAKER";
|
|
9
|
+
})(RedisDatabase = exports.RedisDatabase || (exports.RedisDatabase = {}));
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { MulingstreamChunkManager, MulingstreamChunkData } from '../managers/mulingstream-chunk-manager';
|
|
2
|
-
export interface ChunkLogOptions {
|
|
3
|
-
chunkId?: boolean;
|
|
4
|
-
chunkNumber?: boolean;
|
|
5
|
-
roomId?: boolean;
|
|
6
|
-
language?: boolean;
|
|
7
|
-
processLength?: boolean;
|
|
8
|
-
finalTranscription?: boolean;
|
|
9
|
-
sttStatus?: boolean;
|
|
10
|
-
audioFilePath?: boolean;
|
|
11
|
-
stt?: boolean;
|
|
12
|
-
translation?: boolean;
|
|
13
|
-
tts?: boolean;
|
|
14
|
-
label?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare class MulingstreamChunkLogger extends MulingstreamChunkManager {
|
|
17
|
-
logChunk(roomId: string, chunkNumber: number, opts?: ChunkLogOptions): Promise<void>;
|
|
18
|
-
logChunks(roomId: string, opts?: ChunkLogOptions): Promise<Record<string, unknown>[]>;
|
|
19
|
-
mapChunk(chunk: MulingstreamChunkData, cfg?: ChunkLogOptions): Record<string, unknown>;
|
|
20
|
-
}
|
|
1
|
+
import { MulingstreamChunkManager, MulingstreamChunkData } from '../managers/mulingstream-chunk-manager';
|
|
2
|
+
export interface ChunkLogOptions {
|
|
3
|
+
chunkId?: boolean;
|
|
4
|
+
chunkNumber?: boolean;
|
|
5
|
+
roomId?: boolean;
|
|
6
|
+
language?: boolean;
|
|
7
|
+
processLength?: boolean;
|
|
8
|
+
finalTranscription?: boolean;
|
|
9
|
+
sttStatus?: boolean;
|
|
10
|
+
audioFilePath?: boolean;
|
|
11
|
+
stt?: boolean;
|
|
12
|
+
translation?: boolean;
|
|
13
|
+
tts?: boolean;
|
|
14
|
+
label?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class MulingstreamChunkLogger extends MulingstreamChunkManager {
|
|
17
|
+
logChunk(roomId: string, chunkNumber: number, opts?: ChunkLogOptions): Promise<void>;
|
|
18
|
+
logChunks(roomId: string, opts?: ChunkLogOptions): Promise<Record<string, unknown>[]>;
|
|
19
|
+
mapChunk(chunk: MulingstreamChunkData, cfg?: ChunkLogOptions): Record<string, unknown>;
|
|
20
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MulingstreamChunkLogger = void 0;
|
|
4
|
-
const mulingstream_chunk_manager_1 = require("../managers/mulingstream-chunk-manager");
|
|
5
|
-
const defaults = {
|
|
6
|
-
chunkId: false,
|
|
7
|
-
chunkNumber: true,
|
|
8
|
-
audioFilePath: true,
|
|
9
|
-
roomId: false,
|
|
10
|
-
processLength: false,
|
|
11
|
-
language: false,
|
|
12
|
-
finalTranscription: true,
|
|
13
|
-
sttStatus: true,
|
|
14
|
-
stt: false,
|
|
15
|
-
translation: false,
|
|
16
|
-
tts: true,
|
|
17
|
-
label: ''
|
|
18
|
-
};
|
|
19
|
-
class MulingstreamChunkLogger extends mulingstream_chunk_manager_1.MulingstreamChunkManager {
|
|
20
|
-
/* ------------ one chunk ------------------------------------ */
|
|
21
|
-
/* ------------ one chunk ------------------------------------ */
|
|
22
|
-
async logChunk(roomId, chunkNumber, opts = {}) {
|
|
23
|
-
const cfg = { ...defaults, ...opts };
|
|
24
|
-
const prefix = cfg.label ? `[${cfg.label}] ` : '';
|
|
25
|
-
let chunk = await this.getMulingstreamChunkById(roomId, chunkNumber);
|
|
26
|
-
if (!chunk) {
|
|
27
|
-
chunk = await this.getMulingstreamChunkById(roomId, chunkNumber);
|
|
28
|
-
}
|
|
29
|
-
if (!chunk) {
|
|
30
|
-
console.log(`${prefix}[logger] room ${roomId} chunk ${chunkNumber} not found`);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (cfg.label)
|
|
34
|
-
console.log(prefix.trim()); // single-line label
|
|
35
|
-
console.dir(this.mapChunk(chunk, cfg), { depth: null, colors: true });
|
|
36
|
-
}
|
|
37
|
-
/* ------------ all chunks in room ---------------------------- */
|
|
38
|
-
async logChunks(roomId, opts = {}) {
|
|
39
|
-
const cfg = { ...defaults, ...opts };
|
|
40
|
-
const prefix = cfg.label ? `[${cfg.label}] ` : '';
|
|
41
|
-
let chunks = await this.getRoomById(roomId);
|
|
42
|
-
if (!(chunks === null || chunks === void 0 ? void 0 : chunks.length)) {
|
|
43
|
-
chunks = await this.getRoomById(roomId);
|
|
44
|
-
}
|
|
45
|
-
if (!(chunks === null || chunks === void 0 ? void 0 : chunks.length)) {
|
|
46
|
-
console.log(`${prefix}[logger] room ${roomId} is empty / not found`);
|
|
47
|
-
return [];
|
|
48
|
-
}
|
|
49
|
-
const view = chunks.map((c) => this.mapChunk(c, cfg));
|
|
50
|
-
if (cfg.label)
|
|
51
|
-
console.log(prefix.trim());
|
|
52
|
-
console.dir(view, { depth: null, colors: true });
|
|
53
|
-
return view;
|
|
54
|
-
}
|
|
55
|
-
/* ------------ filter helper -------------------------------- */
|
|
56
|
-
mapChunk(chunk, cfg = {}) {
|
|
57
|
-
const o = { ...defaults, ...cfg };
|
|
58
|
-
const out = {};
|
|
59
|
-
if (o.chunkId)
|
|
60
|
-
out.chunkId = chunk.chunkId;
|
|
61
|
-
if (o.roomId)
|
|
62
|
-
out.roomId = chunk.roomId;
|
|
63
|
-
if (o.chunkNumber)
|
|
64
|
-
out.chunkNumber = chunk.chunkNumber;
|
|
65
|
-
if (o.audioFilePath)
|
|
66
|
-
out.audioFilePath = chunk.audioChunk.audioFilePath;
|
|
67
|
-
if (o.processLength)
|
|
68
|
-
out.processLength = Date.now() - chunk.createdAt + 'ms';
|
|
69
|
-
if (o.language)
|
|
70
|
-
out.language = chunk.language;
|
|
71
|
-
if (o.finalTranscription)
|
|
72
|
-
out.finalTranscription = chunk.finalTranscription;
|
|
73
|
-
if (o.sttStatus)
|
|
74
|
-
out.sttStatus = chunk.sttStatus;
|
|
75
|
-
if (o.stt)
|
|
76
|
-
out.stt = chunk.stt;
|
|
77
|
-
if (o.translation)
|
|
78
|
-
out.translation = chunk.translation;
|
|
79
|
-
if (o.tts)
|
|
80
|
-
out.tts = chunk.tts;
|
|
81
|
-
return out;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.MulingstreamChunkLogger = MulingstreamChunkLogger;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MulingstreamChunkLogger = void 0;
|
|
4
|
+
const mulingstream_chunk_manager_1 = require("../managers/mulingstream-chunk-manager");
|
|
5
|
+
const defaults = {
|
|
6
|
+
chunkId: false,
|
|
7
|
+
chunkNumber: true,
|
|
8
|
+
audioFilePath: true,
|
|
9
|
+
roomId: false,
|
|
10
|
+
processLength: false,
|
|
11
|
+
language: false,
|
|
12
|
+
finalTranscription: true,
|
|
13
|
+
sttStatus: true,
|
|
14
|
+
stt: false,
|
|
15
|
+
translation: false,
|
|
16
|
+
tts: true,
|
|
17
|
+
label: ''
|
|
18
|
+
};
|
|
19
|
+
class MulingstreamChunkLogger extends mulingstream_chunk_manager_1.MulingstreamChunkManager {
|
|
20
|
+
/* ------------ one chunk ------------------------------------ */
|
|
21
|
+
/* ------------ one chunk ------------------------------------ */
|
|
22
|
+
async logChunk(roomId, chunkNumber, opts = {}) {
|
|
23
|
+
const cfg = { ...defaults, ...opts };
|
|
24
|
+
const prefix = cfg.label ? `[${cfg.label}] ` : '';
|
|
25
|
+
let chunk = await this.getMulingstreamChunkById(roomId, chunkNumber);
|
|
26
|
+
if (!chunk) {
|
|
27
|
+
chunk = await this.getMulingstreamChunkById(roomId, chunkNumber);
|
|
28
|
+
}
|
|
29
|
+
if (!chunk) {
|
|
30
|
+
console.log(`${prefix}[logger] room ${roomId} chunk ${chunkNumber} not found`);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (cfg.label)
|
|
34
|
+
console.log(prefix.trim()); // single-line label
|
|
35
|
+
console.dir(this.mapChunk(chunk, cfg), { depth: null, colors: true });
|
|
36
|
+
}
|
|
37
|
+
/* ------------ all chunks in room ---------------------------- */
|
|
38
|
+
async logChunks(roomId, opts = {}) {
|
|
39
|
+
const cfg = { ...defaults, ...opts };
|
|
40
|
+
const prefix = cfg.label ? `[${cfg.label}] ` : '';
|
|
41
|
+
let chunks = await this.getRoomById(roomId);
|
|
42
|
+
if (!(chunks === null || chunks === void 0 ? void 0 : chunks.length)) {
|
|
43
|
+
chunks = await this.getRoomById(roomId);
|
|
44
|
+
}
|
|
45
|
+
if (!(chunks === null || chunks === void 0 ? void 0 : chunks.length)) {
|
|
46
|
+
console.log(`${prefix}[logger] room ${roomId} is empty / not found`);
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
const view = chunks.map((c) => this.mapChunk(c, cfg));
|
|
50
|
+
if (cfg.label)
|
|
51
|
+
console.log(prefix.trim());
|
|
52
|
+
console.dir(view, { depth: null, colors: true });
|
|
53
|
+
return view;
|
|
54
|
+
}
|
|
55
|
+
/* ------------ filter helper -------------------------------- */
|
|
56
|
+
mapChunk(chunk, cfg = {}) {
|
|
57
|
+
const o = { ...defaults, ...cfg };
|
|
58
|
+
const out = {};
|
|
59
|
+
if (o.chunkId)
|
|
60
|
+
out.chunkId = chunk.chunkId;
|
|
61
|
+
if (o.roomId)
|
|
62
|
+
out.roomId = chunk.roomId;
|
|
63
|
+
if (o.chunkNumber)
|
|
64
|
+
out.chunkNumber = chunk.chunkNumber;
|
|
65
|
+
if (o.audioFilePath)
|
|
66
|
+
out.audioFilePath = chunk.audioChunk.audioFilePath;
|
|
67
|
+
if (o.processLength)
|
|
68
|
+
out.processLength = Date.now() - chunk.createdAt + 'ms';
|
|
69
|
+
if (o.language)
|
|
70
|
+
out.language = chunk.language;
|
|
71
|
+
if (o.finalTranscription)
|
|
72
|
+
out.finalTranscription = chunk.finalTranscription;
|
|
73
|
+
if (o.sttStatus)
|
|
74
|
+
out.sttStatus = chunk.sttStatus;
|
|
75
|
+
if (o.stt)
|
|
76
|
+
out.stt = chunk.stt;
|
|
77
|
+
if (o.translation)
|
|
78
|
+
out.translation = chunk.translation;
|
|
79
|
+
if (o.tts)
|
|
80
|
+
out.tts = chunk.tts;
|
|
81
|
+
return out;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.MulingstreamChunkLogger = MulingstreamChunkLogger;
|
|
@@ -1,111 +1,112 @@
|
|
|
1
|
-
import { RedisClient } from '../redis-client';
|
|
2
|
-
export type StepStatus = 'INIT' | 'DISCARDED' | 'READY' | 'USED';
|
|
3
|
-
export type SttService = 'azure' | 'whisper' | 'deepgram';
|
|
4
|
-
export type SttProvider = {
|
|
5
|
-
service: SttService;
|
|
6
|
-
model?: string;
|
|
7
|
-
};
|
|
8
|
-
export type MulingstreamChunkData = {
|
|
9
|
-
chunkId: string;
|
|
10
|
-
roomId: string;
|
|
11
|
-
chunkNumber: number;
|
|
12
|
-
language: string;
|
|
13
|
-
sttProviders: SttProvider[];
|
|
14
|
-
targetLanguages: string[];
|
|
15
|
-
shortCodeTargetLanguages: string[];
|
|
16
|
-
finalTranscription: string;
|
|
17
|
-
sttStatus: StepStatus;
|
|
18
|
-
createdAt: number;
|
|
19
|
-
audioChunk: {
|
|
20
|
-
start: number;
|
|
21
|
-
end: number;
|
|
22
|
-
duration: number;
|
|
23
|
-
isFirst: boolean;
|
|
24
|
-
isLast: boolean;
|
|
25
|
-
audioFilePath: string;
|
|
26
|
-
};
|
|
27
|
-
stt: {
|
|
28
|
-
[service: string]: {
|
|
29
|
-
transcription: string;
|
|
30
|
-
model?: string;
|
|
31
|
-
status: StepStatus;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
translation: {
|
|
35
|
-
[language: string]: {
|
|
36
|
-
translation: string;
|
|
37
|
-
status: StepStatus;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
tts: {
|
|
41
|
-
[language: string]: {
|
|
42
|
-
ttsAudioPath: string;
|
|
43
|
-
status: StepStatus;
|
|
44
|
-
isEmitted: boolean;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export declare class MulingstreamChunkManager {
|
|
49
|
-
private redisClient;
|
|
50
|
-
constructor(redisClient: RedisClient);
|
|
51
|
-
private roomZsetKey;
|
|
52
|
-
private chunkHashKey;
|
|
53
|
-
private generateChunkId;
|
|
54
|
-
private serialize;
|
|
55
|
-
private deserialize;
|
|
56
|
-
private hashToChunk;
|
|
57
|
-
private getTimeout;
|
|
58
|
-
initRoom(roomId: string): Promise<boolean>;
|
|
59
|
-
getRooms(): Promise<string[]>;
|
|
60
|
-
getMulingstreamChunksByRoom(roomId: string): Promise<MulingstreamChunkData[] | null>;
|
|
61
|
-
getRoomById(roomId: string): Promise<MulingstreamChunkData[]>;
|
|
62
|
-
addMulingstreamChunk(params: {
|
|
63
|
-
roomId: string;
|
|
64
|
-
chunkNumber: number;
|
|
65
|
-
language: string;
|
|
66
|
-
start: number;
|
|
67
|
-
end: number;
|
|
68
|
-
duration: number;
|
|
69
|
-
isFirst: boolean;
|
|
70
|
-
isLast: boolean;
|
|
71
|
-
sttProviders: SttProvider[];
|
|
72
|
-
targetLanguages: string[];
|
|
73
|
-
shortCodeTargetLanguages: string[];
|
|
74
|
-
}): Promise<MulingstreamChunkData>;
|
|
75
|
-
private getChunkId;
|
|
76
|
-
getMulingstreamChunkById(roomId: string, n: number): Promise<MulingstreamChunkData>;
|
|
77
|
-
private withChunk;
|
|
78
|
-
updateAudioFilePath(roomId: string, chunkNumber: number, audioFilePath: string): Promise<MulingstreamChunkData | null>;
|
|
79
|
-
updateStt(roomId: string, n: number, service: SttService, opt: {
|
|
80
|
-
transcription?: string;
|
|
81
|
-
sttStatus?: StepStatus;
|
|
82
|
-
}): Promise<MulingstreamChunkData | null>;
|
|
83
|
-
updateSttObject(roomId: string, n: number, newStt: Record<string, {
|
|
84
|
-
transcription: string;
|
|
85
|
-
model?: string;
|
|
86
|
-
status: StepStatus;
|
|
87
|
-
}>): Promise<MulingstreamChunkData | null>;
|
|
88
|
-
discardStt(roomId: string, n: number): Promise<MulingstreamChunkData | null>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
import { RedisClient } from '../redis-client';
|
|
2
|
+
export type StepStatus = 'INIT' | 'DISCARDED' | 'READY' | 'USED';
|
|
3
|
+
export type SttService = 'azure' | 'whisper' | 'deepgram';
|
|
4
|
+
export type SttProvider = {
|
|
5
|
+
service: SttService;
|
|
6
|
+
model?: string;
|
|
7
|
+
};
|
|
8
|
+
export type MulingstreamChunkData = {
|
|
9
|
+
chunkId: string;
|
|
10
|
+
roomId: string;
|
|
11
|
+
chunkNumber: number;
|
|
12
|
+
language: string;
|
|
13
|
+
sttProviders: SttProvider[];
|
|
14
|
+
targetLanguages: string[];
|
|
15
|
+
shortCodeTargetLanguages: string[];
|
|
16
|
+
finalTranscription: string;
|
|
17
|
+
sttStatus: StepStatus;
|
|
18
|
+
createdAt: number;
|
|
19
|
+
audioChunk: {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
duration: number;
|
|
23
|
+
isFirst: boolean;
|
|
24
|
+
isLast: boolean;
|
|
25
|
+
audioFilePath: string;
|
|
26
|
+
};
|
|
27
|
+
stt: {
|
|
28
|
+
[service: string]: {
|
|
29
|
+
transcription: string;
|
|
30
|
+
model?: string;
|
|
31
|
+
status: StepStatus;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
translation: {
|
|
35
|
+
[language: string]: {
|
|
36
|
+
translation: string;
|
|
37
|
+
status: StepStatus;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
tts: {
|
|
41
|
+
[language: string]: {
|
|
42
|
+
ttsAudioPath: string;
|
|
43
|
+
status: StepStatus;
|
|
44
|
+
isEmitted: boolean;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
export declare class MulingstreamChunkManager {
|
|
49
|
+
private redisClient;
|
|
50
|
+
constructor(redisClient: RedisClient);
|
|
51
|
+
private roomZsetKey;
|
|
52
|
+
private chunkHashKey;
|
|
53
|
+
private generateChunkId;
|
|
54
|
+
private serialize;
|
|
55
|
+
private deserialize;
|
|
56
|
+
private hashToChunk;
|
|
57
|
+
private getTimeout;
|
|
58
|
+
initRoom(roomId: string): Promise<boolean>;
|
|
59
|
+
getRooms(): Promise<string[]>;
|
|
60
|
+
getMulingstreamChunksByRoom(roomId: string): Promise<MulingstreamChunkData[] | null>;
|
|
61
|
+
getRoomById(roomId: string): Promise<MulingstreamChunkData[]>;
|
|
62
|
+
addMulingstreamChunk(params: {
|
|
63
|
+
roomId: string;
|
|
64
|
+
chunkNumber: number;
|
|
65
|
+
language: string;
|
|
66
|
+
start: number;
|
|
67
|
+
end: number;
|
|
68
|
+
duration: number;
|
|
69
|
+
isFirst: boolean;
|
|
70
|
+
isLast: boolean;
|
|
71
|
+
sttProviders: SttProvider[];
|
|
72
|
+
targetLanguages: string[];
|
|
73
|
+
shortCodeTargetLanguages: string[];
|
|
74
|
+
}): Promise<MulingstreamChunkData>;
|
|
75
|
+
private getChunkId;
|
|
76
|
+
getMulingstreamChunkById(roomId: string, n: number): Promise<MulingstreamChunkData>;
|
|
77
|
+
private withChunk;
|
|
78
|
+
updateAudioFilePath(roomId: string, chunkNumber: number, audioFilePath: string): Promise<MulingstreamChunkData | null>;
|
|
79
|
+
updateStt(roomId: string, n: number, service: SttService, opt: {
|
|
80
|
+
transcription?: string;
|
|
81
|
+
sttStatus?: StepStatus;
|
|
82
|
+
}): Promise<MulingstreamChunkData | null>;
|
|
83
|
+
updateSttObject(roomId: string, n: number, newStt: Record<string, {
|
|
84
|
+
transcription: string;
|
|
85
|
+
model?: string;
|
|
86
|
+
status: StepStatus;
|
|
87
|
+
}>): Promise<MulingstreamChunkData | null>;
|
|
88
|
+
discardStt(roomId: string, n: number): Promise<MulingstreamChunkData | null>;
|
|
89
|
+
updateSttAsUsed(roomId: string, chunkNumber: number): Promise<MulingstreamChunkData | null>;
|
|
90
|
+
updateFinalTranscription(roomId: string, n: number, opt: {
|
|
91
|
+
transcription?: string;
|
|
92
|
+
sttStatus?: StepStatus;
|
|
93
|
+
}): Promise<MulingstreamChunkData | null>;
|
|
94
|
+
discardPostStt(roomId: string, n: number): Promise<MulingstreamChunkData | null>;
|
|
95
|
+
discardLanguage(roomId: string, n: number, lang: string): Promise<MulingstreamChunkData | null>;
|
|
96
|
+
discardLanguages(roomId: string, n: number, opt: {
|
|
97
|
+
translation?: string[];
|
|
98
|
+
tts?: string[];
|
|
99
|
+
}): Promise<MulingstreamChunkData | null>;
|
|
100
|
+
updateTranslation(roomId: string, n: number, lang: string, opt: {
|
|
101
|
+
translation?: string;
|
|
102
|
+
status?: StepStatus;
|
|
103
|
+
}): Promise<MulingstreamChunkData | null>;
|
|
104
|
+
updateTranslationInBulk(roomId: string, n: number, dict: Record<string, string>, status?: StepStatus): Promise<MulingstreamChunkData | null>;
|
|
105
|
+
updateTts(roomId: string, n: number, lang: string, opt: {
|
|
106
|
+
ttsAudioPath?: string;
|
|
107
|
+
status?: StepStatus;
|
|
108
|
+
isEmitted?: boolean;
|
|
109
|
+
}): Promise<MulingstreamChunkData | null>;
|
|
110
|
+
areTranslationsProcessed(roomId: string, n: number): Promise<boolean>;
|
|
111
|
+
getAllReadyTts(roomId: string, lang: string): Promise<MulingstreamChunkData[]>;
|
|
112
|
+
}
|