ADV-Plugin/qml/WSocket.qml

21 lines
417 B
QML
Raw Normal View History

2022-03-20 12:25:29 +08:00
import QtWebSockets 1.1
import "."
WebSocket {
url: "ws://" + Common.wsIp + ":" + Common.wsPort
2022-03-20 12:25:29 +08:00
active: true
onStatusChanged: {
if(status === WebSocket.Closed || status === WebSocket.Error) {
Common.rebootFlag = true;
2022-03-20 12:25:29 +08:00
}
}
onBinaryMessageReceived: {
let arrayBuffer = new Float32Array(message);
Common.audioDataUpdated(arrayBuffer.slice());
}
}