@rimori/client 2.5.19-next.3 → 2.5.19-next.4
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.
|
@@ -6,6 +6,7 @@ export declare class MessageSender {
|
|
|
6
6
|
private voice;
|
|
7
7
|
private voiceBackend;
|
|
8
8
|
private cache;
|
|
9
|
+
private voiceSpeed;
|
|
9
10
|
constructor(voiceBackend: VoiceBackend, voice: string, cache?: boolean);
|
|
10
11
|
private getCompletedSentences;
|
|
11
12
|
handleNewText(currentText: string | undefined, isLoading: boolean): Promise<void>;
|
|
@@ -17,5 +18,6 @@ export declare class MessageSender {
|
|
|
17
18
|
setVolume(volume: number): void;
|
|
18
19
|
setOnLoudnessChange(callback: (value: number) => void): void;
|
|
19
20
|
setOnEndOfSpeech(callback: () => void): void;
|
|
21
|
+
setVoiceSpeed(speed: number): void;
|
|
20
22
|
}
|
|
21
23
|
export {};
|
|
@@ -13,6 +13,7 @@ export class MessageSender {
|
|
|
13
13
|
this.player = new ChunkedAudioPlayer();
|
|
14
14
|
this.fetchedSentences = new Set();
|
|
15
15
|
this.lastLoading = false;
|
|
16
|
+
this.voiceSpeed = 1;
|
|
16
17
|
if ((voice === null || voice === void 0 ? void 0 : voice.split('_').length) !== 2) {
|
|
17
18
|
throw new Error("Invalid voice id format '" + voice + "'. Voice id needs to look like <provider>_<voice_id>");
|
|
18
19
|
}
|
|
@@ -63,7 +64,7 @@ export class MessageSender {
|
|
|
63
64
|
}
|
|
64
65
|
generateSpeech(sentence) {
|
|
65
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const blob = yield this.voiceBackend(sentence, this.voice,
|
|
67
|
+
const blob = yield this.voiceBackend(sentence, this.voice, this.voiceSpeed, undefined, this.cache);
|
|
67
68
|
return yield blob.arrayBuffer();
|
|
68
69
|
});
|
|
69
70
|
}
|
|
@@ -92,4 +93,7 @@ export class MessageSender {
|
|
|
92
93
|
setOnEndOfSpeech(callback) {
|
|
93
94
|
this.player.setOnEndOfSpeech(callback);
|
|
94
95
|
}
|
|
96
|
+
setVoiceSpeed(speed) {
|
|
97
|
+
this.voiceSpeed = speed;
|
|
98
|
+
}
|
|
95
99
|
}
|