fmode-ng 0.0.7 → 0.0.8
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/esm2020/lib/aigc/avatar/avatar.module.mjs +10 -0
- package/esm2020/lib/aigc/avatar/comp-avatar-particle/avatar.role.mjs +10 -0
- package/esm2020/lib/aigc/avatar/comp-avatar-particle/comp-avatar-particle.component.mjs +10 -0
- package/esm2020/lib/aigc/avatar/comp-avatar-particle/index.mjs +10 -0
- package/esm2020/lib/aigc/avatar/comp-avatar-particle/role-points.class.mjs +10 -0
- package/esm2020/lib/aigc/avatar/comp-avatar-role-image/comp-avatar-role-image.component.mjs +10 -0
- package/esm2020/lib/aigc/avatar/comp-avatar-talk/comp-avatar-talk.component.mjs +10 -0
- package/esm2020/lib/aigc/avatar/index.mjs +10 -0
- package/esm2020/lib/aigc/avatar/interface-avatar-role.mjs +10 -0
- package/esm2020/lib/aigc/comp-markdown-preview/markdown-preview.component.mjs +1 -1
- package/esm2020/lib/aigc/index.mjs +1 -1
- package/esm2020/lib/aigc/service-fmai/service-chat/chat-class.mjs +1 -1
- package/esm2020/lib/aigc/service-fmai/service-imagine/imagine.service.mjs +1 -1
- package/esm2020/lib/aigc/voice/class-asr.mjs +1 -1
- package/esm2020/lib/aigc/voice/fmode-voice.service.mjs +1 -1
- package/esm2020/lib/nova-cloud/nova-cloud.service.mjs +1 -1
- package/esm2020/lib/platform/cross.service.mjs +10 -0
- package/esm2020/lib/platform/index.mjs +10 -0
- package/esm2020/public-api.mjs +1 -1
- package/fesm2015/fmode-ng.mjs +1 -1
- package/fesm2015/fmode-ng.mjs.map +1 -1
- package/fesm2020/fmode-ng.mjs +1 -1
- package/fesm2020/fmode-ng.mjs.map +1 -1
- package/lib/aigc/avatar/avatar.module.d.ts +13 -0
- package/lib/aigc/avatar/comp-avatar-particle/avatar.role.d.ts +15 -0
- package/lib/aigc/avatar/comp-avatar-particle/comp-avatar-particle.component.d.ts +40 -0
- package/lib/aigc/avatar/comp-avatar-particle/index.d.ts +2 -0
- package/lib/aigc/avatar/comp-avatar-particle/role-points.class.d.ts +18 -0
- package/lib/aigc/avatar/comp-avatar-role-image/comp-avatar-role-image.component.d.ts +18 -0
- package/lib/aigc/avatar/comp-avatar-talk/comp-avatar-talk.component.d.ts +45 -0
- package/lib/aigc/avatar/index.d.ts +5 -0
- package/lib/aigc/avatar/interface-avatar-role.d.ts +3 -0
- package/lib/aigc/index.d.ts +1 -0
- package/lib/aigc/service-fmai/service-chat/chat-class.d.ts +6 -1
- package/lib/aigc/service-fmai/service-imagine/imagine.service.d.ts +22 -8
- package/lib/aigc/voice/class-asr.d.ts +4 -1
- package/lib/aigc/voice/fmode-voice.service.d.ts +22 -3
- package/lib/platform/cross.service.d.ts +13 -0
- package/lib/platform/index.d.ts +1 -0
- package/package.json +2 -1
- package/public-api.d.ts +1 -0
- package/src/lib/aigc/voice/demo2/tts-demo/README.md +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Routes } from '@angular/router';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/common";
|
|
4
|
+
import * as i2 from "@angular/forms";
|
|
5
|
+
import * as i3 from "@angular/common/http";
|
|
6
|
+
import * as i4 from "@angular/router";
|
|
7
|
+
import * as i5 from "./comp-avatar-talk/comp-avatar-talk.component";
|
|
8
|
+
export declare const AvatarRoutes: Routes;
|
|
9
|
+
export declare class AvatarModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AvatarModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AvatarModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i3.HttpClientModule, typeof i2.ReactiveFormsModule, typeof i4.RouterModule, typeof i5.CompAvatarTalkComponent], [typeof i5.CompAvatarTalkComponent]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AvatarModule>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as BABYLON from '@babylonjs/core';
|
|
2
|
+
export interface AvatarRole {
|
|
3
|
+
scene: BABYLON.Scene;
|
|
4
|
+
engine: BABYLON.Engine;
|
|
5
|
+
constructor: Function;
|
|
6
|
+
init: Function;
|
|
7
|
+
Mesh: BABYLON.Mesh;
|
|
8
|
+
AnimMap: {
|
|
9
|
+
idle: BABYLON.Animation;
|
|
10
|
+
};
|
|
11
|
+
playAnim: Function;
|
|
12
|
+
loadMesh: Function;
|
|
13
|
+
loadIdleAnim: Function;
|
|
14
|
+
offsetPosition: BABYLON.Vector3;
|
|
15
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* npm i -S @babylonjs/core
|
|
4
|
+
* npm i -S @babylonjs/loaders
|
|
5
|
+
*/
|
|
6
|
+
import * as BABYLON from '@babylonjs/core';
|
|
7
|
+
import '@babylonjs/loaders';
|
|
8
|
+
import { AvatarRole } from './avatar.role';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class CompAvatarParticleComponent implements AfterViewInit {
|
|
11
|
+
private elementRef;
|
|
12
|
+
renderCanvas: ElementRef;
|
|
13
|
+
private canvas;
|
|
14
|
+
private engine;
|
|
15
|
+
private scene;
|
|
16
|
+
mainCamera: BABYLON.ArcRotateCamera | BABYLON.VRDeviceOrientationArcRotateCamera | undefined;
|
|
17
|
+
constructor(elementRef: ElementRef);
|
|
18
|
+
ngAfterViewInit(): void;
|
|
19
|
+
currentRole: AvatarRole;
|
|
20
|
+
createScene(): Promise<void>;
|
|
21
|
+
isWebVR: boolean;
|
|
22
|
+
createCamera(): BABYLON.ArcRotateCamera;
|
|
23
|
+
mainMesh: BABYLON.AbstractMesh | undefined;
|
|
24
|
+
pointsCloud: BABYLON.PointsCloudSystem;
|
|
25
|
+
pointsMesh: BABYLON.Mesh;
|
|
26
|
+
createCloudPoints(): Promise<void>;
|
|
27
|
+
playAnimation(name: any): void;
|
|
28
|
+
cloudAnim(options?: {
|
|
29
|
+
breathing: boolean;
|
|
30
|
+
rotateSpeed: number;
|
|
31
|
+
}): void;
|
|
32
|
+
animMap: {
|
|
33
|
+
[key: string]: BABYLON.Animation;
|
|
34
|
+
};
|
|
35
|
+
createSphere(): BABYLON.Mesh;
|
|
36
|
+
createParticle(): Promise<void>;
|
|
37
|
+
setCameraToMeshCenter(camera: BABYLON.ArcRotateCamera | undefined, mesh: BABYLON.AbstractMesh): void;
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CompAvatarParticleComponent, never>;
|
|
39
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompAvatarParticleComponent, "fm-avatar-role-particle", never, {}, {}, never, never, true, never>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as BABYLON from '@babylonjs/core';
|
|
2
|
+
import '@babylonjs/loaders';
|
|
3
|
+
import { AvatarRole } from './avatar.role';
|
|
4
|
+
export declare class RolePointsCloud implements AvatarRole {
|
|
5
|
+
scene: BABYLON.Scene;
|
|
6
|
+
engine: BABYLON.Engine;
|
|
7
|
+
constructor(scene: any, engine: any, camera: any);
|
|
8
|
+
Mesh: BABYLON.Mesh;
|
|
9
|
+
offsetPosition: BABYLON.Vector3;
|
|
10
|
+
animationGroup: BABYLON.AnimationGroup;
|
|
11
|
+
AnimMap: {
|
|
12
|
+
idle: any;
|
|
13
|
+
};
|
|
14
|
+
init(): Promise<void>;
|
|
15
|
+
playAnim(anim: any): void;
|
|
16
|
+
loadMesh(): BABYLON.Mesh;
|
|
17
|
+
loadIdleAnim(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
|
2
|
+
import { FmodeAvatarRoleComp } from '../interface-avatar-role';
|
|
3
|
+
import 'recorder-core/src/extensions/waveview';
|
|
4
|
+
import * as Parse from "parse";
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class CompAvatarRoleImageComponent implements FmodeAvatarRoleComp, AfterViewInit {
|
|
7
|
+
avatarImage: ElementRef;
|
|
8
|
+
animClass: string;
|
|
9
|
+
role: Parse.Object;
|
|
10
|
+
wave: any;
|
|
11
|
+
waveInterval: any;
|
|
12
|
+
playWave(): void;
|
|
13
|
+
stopWave(): void;
|
|
14
|
+
ngAfterViewInit(): void;
|
|
15
|
+
playAnimation(name: string): void;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CompAvatarRoleImageComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompAvatarRoleImageComponent, "fm-avatar-role-image", never, { "role": "role"; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FmodeVoiceService } from '../../voice';
|
|
3
|
+
import { FmodeAvatarRoleComp } from '../interface-avatar-role';
|
|
4
|
+
import { Platform } from "@ionic/angular";
|
|
5
|
+
import { ActivatedRoute } from '@angular/router';
|
|
6
|
+
import * as Parse from "parse";
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class CompAvatarTalkComponent implements AfterViewInit, OnDestroy {
|
|
9
|
+
voiceServ: FmodeVoiceService;
|
|
10
|
+
private platform;
|
|
11
|
+
private route;
|
|
12
|
+
avatarComp: FmodeAvatarRoleComp;
|
|
13
|
+
avatarRole: Parse.Object;
|
|
14
|
+
constructor(voiceServ: FmodeVoiceService, platform: Platform, route: ActivatedRoute);
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
loadAvatarRole(roleId: any): Promise<void>;
|
|
17
|
+
player: HTMLAudioElement;
|
|
18
|
+
playMusic(action: any): void;
|
|
19
|
+
ngAfterViewInit(): void;
|
|
20
|
+
aiRespComp: ElementRef;
|
|
21
|
+
listenDivChange(): void;
|
|
22
|
+
scrollToBottom(comp: ElementRef): void;
|
|
23
|
+
initAvatar(): Promise<void>;
|
|
24
|
+
onRecordButtonClick(): void;
|
|
25
|
+
tipsTalk: string;
|
|
26
|
+
startTalk(event?: any): Promise<void>;
|
|
27
|
+
cancelTalk(): void;
|
|
28
|
+
stopTalkAndSend(event?: any): void;
|
|
29
|
+
aiResponseText: string;
|
|
30
|
+
sendMessage(): void;
|
|
31
|
+
playRecord(): void;
|
|
32
|
+
playBuffers(): void;
|
|
33
|
+
/**
|
|
34
|
+
* ASR
|
|
35
|
+
*/
|
|
36
|
+
startASR(): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* TTS
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
testTTS(sentence?: any): void;
|
|
42
|
+
testXunfeiTTS(): void;
|
|
43
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CompAvatarTalkComponent, never>;
|
|
44
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompAvatarTalkComponent, "app-comp-avatar-talk", never, {}, {}, never, never, true, never>;
|
|
45
|
+
}
|
package/lib/aigc/index.d.ts
CHANGED
|
@@ -30,5 +30,10 @@ export declare class FmodeChatCompletion {
|
|
|
30
30
|
contentPusher: NodeJS.Timeout;
|
|
31
31
|
isCompleted: boolean;
|
|
32
32
|
constructor(messages: FmodeChatMessage[]);
|
|
33
|
-
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param isDirect 是否不等待逐字获取,直接完成内容推送
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
sendCompletion(isDirect?: boolean): Observable<FmodeChatMessage>;
|
|
34
39
|
}
|
|
@@ -2,6 +2,14 @@ import { HttpClient } from '@angular/common/http';
|
|
|
2
2
|
import { NovaCloudService } from '../../../nova-cloud/nova-cloud.service';
|
|
3
3
|
import * as Parse from "parse";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
+
export interface DalleOptions {
|
|
6
|
+
prompt: string;
|
|
7
|
+
quality?: null | "hd";
|
|
8
|
+
n?: 1;
|
|
9
|
+
model?: "dall-e-3" | "dall-e-2";
|
|
10
|
+
size?: "1024x1024" | "1792x1024" | "1024x1792";
|
|
11
|
+
style?: "vivid" | "natural";
|
|
12
|
+
}
|
|
5
13
|
export declare class ImagineService {
|
|
6
14
|
private http;
|
|
7
15
|
private ncloud;
|
|
@@ -10,15 +18,20 @@ export declare class ImagineService {
|
|
|
10
18
|
*/
|
|
11
19
|
constructor(http: HttpClient, ncloud: NovaCloudService);
|
|
12
20
|
/**
|
|
13
|
-
* DALL-E
|
|
21
|
+
* DALL-E-3 图片生成函数
|
|
14
22
|
* @description
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
* @see
|
|
24
|
+
* https://p4.hosteagle.club/docs/api-reference?__cpo=aHR0cHM6Ly9wbGF0Zm9ybS5vcGVuYWkuY29t
|
|
25
|
+
* @param {DalleOptions} options
|
|
26
|
+
* @param {string} options.prompt 1000 characters for dall-e-2 and 4000 characters for dall-e-3.
|
|
27
|
+
* @param {string} options.model dall-e-3 dall-e-2
|
|
28
|
+
* @param {string} options.quality dall-e-3 only hd means more details & consistency
|
|
29
|
+
* @param {string} options.response_format url | b64_json
|
|
30
|
+
* @param {string} options.size 1024x1024, 1792x1024, or 1024x1792 for dall-e-3
|
|
31
|
+
* @param {string} options.style vivid | natural dall-e-3 only
|
|
32
|
+
*/
|
|
33
|
+
drawDalle(options: DalleOptions): Promise<any>;
|
|
34
|
+
priceDalle(options: DalleOptions): any;
|
|
22
35
|
b64DataToBase64Image(b64_json: any): void;
|
|
23
36
|
/**
|
|
24
37
|
* Huashi6专用绘图函数
|
|
@@ -39,6 +52,7 @@ export declare class ImagineService {
|
|
|
39
52
|
/**
|
|
40
53
|
* 我的绘画作品共享方法
|
|
41
54
|
*/
|
|
55
|
+
newWorkList: Array<Parse.Object>;
|
|
42
56
|
myWorkList: Array<Parse.Object>;
|
|
43
57
|
getMyWorkQuery(): Parse.Query<Parse.Object<Parse.Attributes>>;
|
|
44
58
|
getWorkQuery(): Parse.Query<Parse.Object<Parse.Attributes>>;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { Platform } from "@ionic/angular";
|
|
1
2
|
export declare class WebSpeech {
|
|
2
|
-
|
|
3
|
+
private platform;
|
|
4
|
+
constructor(platform: Platform);
|
|
3
5
|
/**
|
|
4
6
|
* 语音识别
|
|
5
7
|
* @desc
|
|
@@ -20,5 +22,6 @@ export declare class WebSpeech {
|
|
|
20
22
|
* https://zhuanlan.zhihu.com/p/141582231
|
|
21
23
|
*/
|
|
22
24
|
speak(sentence: any, pitch?: number, rate?: number, volume?: number): void;
|
|
25
|
+
speakWithEdge(sentence: any, pitch?: number, rate?: number, volume?: number): void;
|
|
23
26
|
getVoiceByName(name: any): SpeechSynthesisVoice;
|
|
24
27
|
}
|
|
@@ -2,18 +2,24 @@ import 'recorder-core/src/engine/pcm';
|
|
|
2
2
|
import 'recorder-core/src/engine/wav';
|
|
3
3
|
import 'recorder-core/src/extensions/waveview';
|
|
4
4
|
import { WebSpeech } from './class-asr';
|
|
5
|
+
import { Platform } from '@ionic/angular';
|
|
6
|
+
import { Diagnostic } from '@awesome-cordova-plugins/diagnostic/ngx';
|
|
5
7
|
import * as i0 from "@angular/core";
|
|
6
8
|
export declare class FmodeVoiceService {
|
|
9
|
+
private platform;
|
|
10
|
+
private diagnostic;
|
|
7
11
|
/**
|
|
8
12
|
* 关闭ASR:用于测试其他功能时,可关闭ASR节省语音接口消耗
|
|
9
13
|
*/
|
|
10
14
|
disableASR: false;
|
|
15
|
+
/**
|
|
16
|
+
* 讯飞TTS语音合成
|
|
17
|
+
*/
|
|
11
18
|
/**
|
|
12
19
|
* WebSpeech 语音库
|
|
13
20
|
*/
|
|
14
21
|
webSpeech: typeof WebSpeech;
|
|
15
|
-
constructor();
|
|
16
|
-
onRecordButtonClick(): void;
|
|
22
|
+
constructor(platform: Platform, diagnostic: Diagnostic);
|
|
17
23
|
recordStart(): Promise<void>;
|
|
18
24
|
recordStop(): void;
|
|
19
25
|
recordPcmBlob: Blob;
|
|
@@ -27,7 +33,7 @@ export declare class FmodeVoiceService {
|
|
|
27
33
|
recordType: string;
|
|
28
34
|
encodingType: string;
|
|
29
35
|
createRecorder(): void;
|
|
30
|
-
openWithPriviledge():
|
|
36
|
+
openWithPriviledge(): Promise<unknown>;
|
|
31
37
|
connStatus: string;
|
|
32
38
|
btnStatus: string;
|
|
33
39
|
waveClient: any;
|
|
@@ -49,6 +55,19 @@ export declare class FmodeVoiceService {
|
|
|
49
55
|
changeBtnStatus(status: any): void;
|
|
50
56
|
renderResult(resultData: any): void;
|
|
51
57
|
connectWebSocket(): void;
|
|
58
|
+
/**
|
|
59
|
+
* 移动端兼容方法
|
|
60
|
+
*/
|
|
61
|
+
/**
|
|
62
|
+
* 移动端上传专用方法
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
isCapacitor(): boolean;
|
|
66
|
+
requestPermission(): Promise<void>;
|
|
67
|
+
requestRecordAudioPermission(): Promise<void>;
|
|
68
|
+
requestMicPermission(): Promise<void>;
|
|
69
|
+
requestStoagePermission(): Promise<void>;
|
|
70
|
+
requestCameraPermission(): Promise<void>;
|
|
52
71
|
static ɵfac: i0.ɵɵFactoryDeclaration<FmodeVoiceService, never>;
|
|
53
72
|
static ɵprov: i0.ɵɵInjectableDeclaration<FmodeVoiceService>;
|
|
54
73
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class CrossService {
|
|
3
|
+
mobileWidth: number;
|
|
4
|
+
clientWidth: number;
|
|
5
|
+
leftMenuMode: string;
|
|
6
|
+
navMenuType: string;
|
|
7
|
+
fixInterval: any;
|
|
8
|
+
constructor();
|
|
9
|
+
updateWidth(): void;
|
|
10
|
+
onResizeScreen(ev?: any): void;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CrossService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<CrossService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./cross.service";
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fmode-ng",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"author": "未来全栈",
|
|
5
5
|
"license": "COPYRIGHT © 未来飞马 未来全栈 www.fmode.cn All RIGHTS RESERVED",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
8
8
|
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
9
9
|
"@angular/forms": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
10
|
+
"@angular/animations": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
10
11
|
"ng-zorro-antd": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
11
12
|
"parse": "^3.0.0 || ^4.0.0",
|
|
12
13
|
"@ionic/angular": "^6.0.0 || ^7.0.0",
|
package/public-api.d.ts
CHANGED
|
File without changes
|