fmode-ng 0.0.32 → 0.0.34
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/esm2022/lib/aigc/avatar/modal-chat-voice-input/modal-chat-voice-input.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-message-area/comp-message-area.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-message-card/comp-message-card.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-modal-input/modal-audio-message/modal-audio-message.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/chat-modal-input/modal-input.component.mjs +1 -1
- package/esm2022/lib/aigc/chat/comp-role-prompt/comp-role-prompt.component.mjs +1 -1
- package/esm2022/lib/aigc/service-fmai/service-chat/chat-class.mjs +1 -1
- package/esm2022/lib/aigc/service-fmai/service-chat/chat.service.mjs +1 -1
- package/esm2022/lib/aigc/service-fmai/service-chat/pipes/chat-content.pipe.mjs +1 -1
- package/esm2022/lib/aigc/voice/fmode-voice.service.mjs +1 -1
- package/esm2022/lib/aigc/voice/lib/pcm2wav.mjs +1 -1
- package/esm2022/lib/aigc/voice/tts/fmode-tts-class.mjs +1 -1
- package/esm2022/lib/storage/service-upload/nova-upload.service.mjs +1 -1
- package/fesm2022/fmode-ng.mjs +1 -1
- package/fesm2022/fmode-ng.mjs.map +1 -1
- package/lib/aigc/chat/chat-message-card/comp-message-card.component.d.ts +3 -0
- package/lib/aigc/chat/chat-modal-input/modal-audio-message/modal-audio-message.component.d.ts +6 -1
- package/lib/aigc/service-fmai/service-chat/chat-class.d.ts +7 -3
- package/lib/aigc/service-fmai/service-chat/chat.service.d.ts +3 -1
- package/lib/aigc/voice/fmode-voice.service.d.ts +6 -2
- package/lib/aigc/voice/lib/pcm2wav.d.ts +1 -1
- package/lib/aigc/voice/tts/fmode-tts-class.d.ts +15 -3
- package/lib/storage/service-upload/nova-upload.service.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,6 +9,9 @@ export declare class FmChatMessageCard {
|
|
|
9
9
|
chat: FmodeChat;
|
|
10
10
|
user: Parse.User;
|
|
11
11
|
constructor(copyServ: ClipboardService);
|
|
12
|
+
isVoicePlaying: boolean;
|
|
13
|
+
playVoice(): Promise<void>;
|
|
14
|
+
updateVoiceDuration(duration: number): void;
|
|
12
15
|
copy(): Promise<void>;
|
|
13
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<FmChatMessageCard, never>;
|
|
14
17
|
static ɵcmp: i0.ɵɵComponentDeclaration<FmChatMessageCard, "fm-chat-message-card", never, { "message": { "alias": "message"; "required": false; }; "role": { "alias": "role"; "required": false; }; "chat": { "alias": "chat"; "required": false; }; }, {}, never, never, true, never>;
|
package/lib/aigc/chat/chat-modal-input/modal-audio-message/modal-audio-message.component.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ModalController, ToastController } from '@ionic/angular/standalone';
|
|
2
2
|
import { FmodeVoiceService } from '../../../voice/fmode-voice.service';
|
|
3
3
|
import { FmodeChat } from '../../../service-fmai/service-chat';
|
|
4
|
+
import { NovaUploadService } from '../../../../storage/service-upload/nova-upload.service';
|
|
5
|
+
import Parse from "parse";
|
|
4
6
|
import * as i0 from "@angular/core";
|
|
5
7
|
export declare class ModalAudioMessageComponent {
|
|
6
8
|
voiceServ: FmodeVoiceService;
|
|
7
9
|
private toastCtrl;
|
|
10
|
+
private uploadServ;
|
|
8
11
|
chat: FmodeChat;
|
|
9
12
|
modal: ModalController;
|
|
10
13
|
now: Date | undefined;
|
|
11
14
|
isRecording: boolean;
|
|
12
|
-
constructor(voiceServ: FmodeVoiceService, toastCtrl: ToastController);
|
|
15
|
+
constructor(voiceServ: FmodeVoiceService, toastCtrl: ToastController, uploadServ: NovaUploadService);
|
|
13
16
|
ngOnInit(): void;
|
|
14
17
|
/**
|
|
15
18
|
* 语音听写服务 ==============================================
|
|
@@ -28,6 +31,8 @@ export declare class ModalAudioMessageComponent {
|
|
|
28
31
|
* 嵌入唤醒词切换逻辑
|
|
29
32
|
*/
|
|
30
33
|
initVoiceSevice(): void;
|
|
34
|
+
chatVoice: Parse.Object;
|
|
35
|
+
saveChatVoice(): Promise<void>;
|
|
31
36
|
sendMessage(): Promise<void>;
|
|
32
37
|
/**
|
|
33
38
|
* 计时器
|
|
@@ -3,8 +3,10 @@ import Parse from "parse";
|
|
|
3
3
|
import { NavController } from "@ionic/angular";
|
|
4
4
|
import { FmodeTTS } from "../../voice/tts";
|
|
5
5
|
import { NovaCloudService } from "../../../nova-cloud";
|
|
6
|
+
import { NovaUploadService } from "../../../storage/service-upload/nova-upload.service";
|
|
6
7
|
export interface FmodeChatMessageVoice {
|
|
7
8
|
id: string;
|
|
9
|
+
duration?: number;
|
|
8
10
|
ssml?: string;
|
|
9
11
|
voiceUrl?: string;
|
|
10
12
|
}
|
|
@@ -78,7 +80,8 @@ export declare class FmodeChat {
|
|
|
78
80
|
isTalkMode: boolean;
|
|
79
81
|
SSMLRoleVoice: string;
|
|
80
82
|
ncloud: NovaCloudService;
|
|
81
|
-
|
|
83
|
+
uploadServ: NovaUploadService;
|
|
84
|
+
constructor(sessionId: string, role?: Parse.Object, chatSession?: Parse.Object, chatServ?: any, navCtrl?: NavController, ncloud?: NovaCloudService, uploadServ?: NovaUploadService);
|
|
82
85
|
/**
|
|
83
86
|
* 会话Avatar控制
|
|
84
87
|
*/
|
|
@@ -97,7 +100,7 @@ export declare class FmodeChat {
|
|
|
97
100
|
* @param message
|
|
98
101
|
* @param imageUrl
|
|
99
102
|
*/
|
|
100
|
-
sendMessage(message?: string, imageUrl?: string, onComplete?: Function, eventMap?: FmodeChatEventMap): Promise<void>;
|
|
103
|
+
sendMessage(message?: string, imageUrl?: string, onComplete?: Function, eventMap?: FmodeChatEventMap, voice?: FmodeChatMessageVoice): Promise<void>;
|
|
101
104
|
getVoiceByContentText(content: string | ChatImageContentItem[], eventMap?: FmodeChatEventMap, promptEnabled?: boolean): Promise<FmodeChatMessageVoice>;
|
|
102
105
|
getContentText(content: string | ChatImageContentItem[]): string;
|
|
103
106
|
/**
|
|
@@ -106,7 +109,8 @@ export declare class FmodeChat {
|
|
|
106
109
|
*/
|
|
107
110
|
tts: FmodeTTS;
|
|
108
111
|
initTTS(): Promise<void>;
|
|
109
|
-
|
|
112
|
+
voiceMap: any;
|
|
113
|
+
playChatVoice(voice: Parse.Object, eventMap?: any): Promise<void>;
|
|
110
114
|
/**
|
|
111
115
|
* 保存单次会话
|
|
112
116
|
*/
|
|
@@ -4,6 +4,7 @@ import Parse from "parse";
|
|
|
4
4
|
import { NovaCloudService } from '../../../nova-cloud';
|
|
5
5
|
import { AlertController, NavController, Platform } from '@ionic/angular';
|
|
6
6
|
import { CrossService } from '../../../platform';
|
|
7
|
+
import { NovaUploadService } from '../../../storage/service-upload/nova-upload.service';
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export declare class ChatService {
|
|
9
10
|
private router;
|
|
@@ -12,11 +13,12 @@ export declare class ChatService {
|
|
|
12
13
|
private alertCtrl;
|
|
13
14
|
private navCtrl;
|
|
14
15
|
private cross;
|
|
16
|
+
private uploadServ;
|
|
15
17
|
chatMap: {
|
|
16
18
|
[key: string]: FmodeChat;
|
|
17
19
|
};
|
|
18
20
|
isCapacitor: boolean;
|
|
19
|
-
constructor(router: Router, ncloud: NovaCloudService, platform: Platform, alertCtrl: AlertController, navCtrl: NavController, cross: CrossService);
|
|
21
|
+
constructor(router: Router, ncloud: NovaCloudService, platform: Platform, alertCtrl: AlertController, navCtrl: NavController, cross: CrossService, uploadServ: NovaUploadService);
|
|
20
22
|
modelList: Array<Parse.Object>;
|
|
21
23
|
currentModel: Parse.Object;
|
|
22
24
|
loadModelList(model?: Parse.Object): Promise<void>;
|
|
@@ -28,6 +28,7 @@ export declare class FmodeVoiceService {
|
|
|
28
28
|
/**
|
|
29
29
|
* 用户操作:完成录音,并处理转录结果
|
|
30
30
|
*/
|
|
31
|
+
isUserFinish: boolean;
|
|
31
32
|
finishTalk(): void;
|
|
32
33
|
onBeforeFinishTalk: Function;
|
|
33
34
|
onAfterFinishTalk: Function;
|
|
@@ -51,10 +52,13 @@ export declare class FmodeVoiceService {
|
|
|
51
52
|
* 程序逻辑
|
|
52
53
|
*/
|
|
53
54
|
recordStart(): Promise<void>;
|
|
54
|
-
recordStop():
|
|
55
|
+
recordStop(): Promise<unknown>;
|
|
56
|
+
recordWavBlob: Blob;
|
|
55
57
|
recordPcmBlob: Blob;
|
|
58
|
+
recordDuration: number;
|
|
56
59
|
playRecord(): void;
|
|
57
|
-
|
|
60
|
+
pcmBlobToWavBlob(pcmBlob: any, sampleRate: any): Promise<Blob>;
|
|
61
|
+
playPCM(pcmBlob: any, sampleRate: any): Promise<void>;
|
|
58
62
|
buffers: Array<any>;
|
|
59
63
|
playBuffers(): Promise<void>;
|
|
60
64
|
BuffersToBlob(buffers: any): Blob;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function pcmtoWav(pcmsrt: any, sampleRate: any, numChannels: any, bitsPerSample: any):
|
|
1
|
+
export declare function pcmtoWav(pcmsrt: any, sampleRate: any, numChannels: any, bitsPerSample: any): Blob;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import Parse from "parse";
|
|
2
|
+
import { NovaUploadService } from "../../../storage/service-upload/nova-upload.service";
|
|
3
|
+
interface FmodeTTSEvent {
|
|
4
|
+
onSpeakBefore?(): void;
|
|
5
|
+
onStreamStarted?(): void;
|
|
6
|
+
onAudioCompleted?(): void;
|
|
7
|
+
}
|
|
1
8
|
/**
|
|
2
9
|
* FmodeTTS
|
|
3
10
|
* 每个类,表示一次独立的语音合成服务
|
|
@@ -9,11 +16,14 @@ export declare class FmodeTTS {
|
|
|
9
16
|
private subscriptionKey;
|
|
10
17
|
private authorizationToken;
|
|
11
18
|
private region;
|
|
19
|
+
eventMap: FmodeTTSEvent;
|
|
20
|
+
uploadServ?: NovaUploadService;
|
|
12
21
|
constructor(config: {
|
|
13
22
|
region: string;
|
|
14
23
|
subscriptionKey: string;
|
|
15
24
|
token: string;
|
|
16
|
-
});
|
|
25
|
+
}, uploadServ?: NovaUploadService);
|
|
26
|
+
extractTextFromXML(inputString: any): string;
|
|
17
27
|
extractSSMLContent(inputString: any): any;
|
|
18
28
|
/**
|
|
19
29
|
* 合成语言并播放
|
|
@@ -23,11 +33,13 @@ export declare class FmodeTTS {
|
|
|
23
33
|
* SSML https://learn.microsoft.com/zh-cn/azure/ai-services/speech-service/how-to-speech-synthesis?tabs=browserjs%2Cterminal&pivots=programming-language-javascript#use-ssml-to-customize-speech-characteristics
|
|
24
34
|
* @returns
|
|
25
35
|
*/
|
|
26
|
-
speakAsync(textOrSSML: string): Promise<
|
|
36
|
+
speakAsync(textOrSSML: string, chatVoice?: Parse.Object, eventMap?: any): Promise<Parse.Object>;
|
|
27
37
|
onBreak(options: {
|
|
28
38
|
playedTime: string;
|
|
29
39
|
playedText: string;
|
|
30
40
|
leftText: string;
|
|
31
41
|
}): void;
|
|
32
|
-
playAudioData(audioData: any): void;
|
|
42
|
+
playAudioData(audioData: string, chatVoice: Parse.Object, eventMap: any): void;
|
|
43
|
+
uploadAndSaveVoice(blob: any, chatVoice: any): Promise<void>;
|
|
33
44
|
}
|
|
45
|
+
export {};
|
|
@@ -121,6 +121,7 @@ export declare class NovaUploadService {
|
|
|
121
121
|
base64ToBlobType(string: any, type: any): Promise<Blob>;
|
|
122
122
|
base64ToBlob(base64Img: string): Promise<Blob>;
|
|
123
123
|
fileToBlob(file: File): Blob;
|
|
124
|
+
genMd5(inputString: string): string;
|
|
124
125
|
static ɵfac: i0.ɵɵFactoryDeclaration<NovaUploadService, never>;
|
|
125
126
|
static ɵprov: i0.ɵɵInjectableDeclaration<NovaUploadService>;
|
|
126
127
|
}
|