update
This commit is contained in:
@@ -47,7 +47,7 @@ app
|
||||
}
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
// https://localhost:51015/client/router?path=shop&key=install
|
||||
// https://localhost:51515/client/router?path=shop&key=install
|
||||
const options = ctx.query?.data || {};
|
||||
const { id, type, force, yes } = options;
|
||||
assistantConfig.checkMounted();
|
||||
@@ -74,7 +74,7 @@ app
|
||||
}
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
// https://localhost:51015/client/router?path=shop&key=uninstall
|
||||
// https://localhost:51515/client/router?path=shop&key=uninstall
|
||||
const options = ctx.query?.data || {};
|
||||
const { id, type, yes } = options;
|
||||
const app = new AppDownload(assistantConfig);
|
||||
|
||||
@@ -93,20 +93,18 @@ const func: WebSocketListenerFun = async (req: WebSocketReq<{ asr: QwenAsrRelati
|
||||
console.log('ASR receive data', 'blank voice');
|
||||
} else if (data?.voice) {
|
||||
if (!data?.isRelatime) {
|
||||
console.log('ASR receive data', 'has voice', !!data?.voice);
|
||||
}
|
||||
const isBrowserFormat = data.format === 'float32';
|
||||
const time = data?.time || 0;
|
||||
if (time) {
|
||||
console.log('ASR receive data', 'has voice', !!data?.voice, data?.isRelatime);
|
||||
const time = data?.time || 0;
|
||||
console.log('receiveDelay', Date.now() - time);
|
||||
}
|
||||
const isBrowserFormat = data.format === 'float32';
|
||||
|
||||
let voice: Buffer;
|
||||
if (isBrowserFormat) {
|
||||
voice = await asr.fixBrowerBuffer(data.voice);
|
||||
} else {
|
||||
voice = Buffer.from(data.voice, 'base64');
|
||||
}
|
||||
console.log('sendTime', Date.now());
|
||||
ws.data.startTime = Date.now();
|
||||
asr.sendBuffer(voice);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ const testRouter = () => {
|
||||
// const ws = new WebSocket('ws://118.196.32.29:3005/api/router');
|
||||
// const ws = new WebSocket('wss://kevisual.cn/api/router');
|
||||
|
||||
// const ws = new WebSocket('ws://localhost:51015/api/ws/demo?id=12345');
|
||||
const ws = new WebSocket('ws://localhost:51015/api/router?id=12345');
|
||||
// const ws = new WebSocket('ws://localhost:51515/api/ws/demo?id=12345');
|
||||
const ws = new WebSocket('ws://localhost:51515/api/router?id=12345');
|
||||
console.log('Connecting to WebSocket server...');
|
||||
ws.on('open', () => {
|
||||
console.log('WebSocket connection opened');
|
||||
|
||||
Reference in New Issue
Block a user