Skip to content

Commit

Permalink
feat: action
Browse files Browse the repository at this point in the history
  • Loading branch information
ylxmf2005 committed Jan 25, 2025
1 parent d13df6c commit dfdae86
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-llm-vtuber-electron",
"version": "1.0.1",
"version": "1.0.0",
"description": "An Electron application with React and TypeScript",
"main": "./out/main/index.js",
"author": "example.com",
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/services/websocket-handler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ function WebSocketHandler({ children }: { children: React.ReactNode }) {
if (aiState === 'interrupted' || aiState === 'listening') {
console.log('Audio playback intercepted. Sentence:', message.text);
} else {
console.log("expressions", message.expressions);
console.log("expressions", message.actions);
addAudioTask({
audioBase64: message.audio || '',
volumes: message.volumes || [],
sliceLength: message.slice_length || 0,
text: message.text || null,
expressions: message.expressions || null,
expressions: message.actions?.expressions || null,
});
}
break;
Expand Down
17 changes: 7 additions & 10 deletions src/renderer/src/services/websocket-service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ export interface Message {
timestamp: string;
}

export interface Actions {
expressions?: string[] | number [];
pictures?: string[];
sounds?: string[];
}

export interface MessageEvent {
type: string;
audio?: string;
volumes?: number[];
slice_length?: number;
files?: BackgroundFile[];
expressions?: string[] | number [];
actions?: Actions;
text?: string;
model_info?: ModelInfo;
conf_name?: string;
Expand Down Expand Up @@ -70,15 +76,6 @@ class WebSocketService {
});
}

private static validateUrl(url: string): boolean {
try {
const urlObj = new URL(url);
return ['ws:', 'wss:'].includes(urlObj.protocol);
} catch (e) {
return false;
}
}

connect(url: string) {
if (this.ws?.readyState === WebSocket.CONNECTING ||
this.ws?.readyState === WebSocket.OPEN) {
Expand Down

0 comments on commit dfdae86

Please sign in to comment.