add audio playback
This commit is contained in:
parent
1611cee234
commit
d06fb395b9
9 changed files with 342 additions and 58 deletions
|
|
@ -5,7 +5,10 @@ import { backgroundMitt } from './emitter';
|
|||
import { ipcMain } from "electron";
|
||||
|
||||
interface RenderMessage {
|
||||
content: string;
|
||||
content: {
|
||||
text: string;
|
||||
audio: boolean | Buffer;
|
||||
};
|
||||
avatar: string;
|
||||
context: string;
|
||||
subContext: string;
|
||||
|
|
@ -24,7 +27,7 @@ interface TextMessage {
|
|||
content: string;
|
||||
}
|
||||
|
||||
const ip = 'ws://127.0.0.1';
|
||||
const ip = 'ws://127.0. 0.1';
|
||||
const port = 8760;
|
||||
const reconnectTimeout = 3000; //ms
|
||||
let socket: WebSocket;
|
||||
|
|
@ -67,6 +70,9 @@ const receiveMessage = (message: string): void => {
|
|||
}
|
||||
|
||||
const parsed: RenderMessage = JSON.parse(message);
|
||||
console.log('message received', parsed);
|
||||
if (parsed.content.audio) {
|
||||
}
|
||||
backgroundMitt.emit('ipc-renderer', {
|
||||
endpoint: 'render-message',
|
||||
message: parsed
|
||||
|
|
|
|||
Loading…
Reference in a new issue