24 lines
470 B
QML
24 lines
470 B
QML
import QtWebSockets 1.1
|
|
|
|
import "."
|
|
|
|
|
|
WebSocket {
|
|
property string wsIp: "localhost"
|
|
property int wsPort: 5050
|
|
|
|
url: "ws://" + wsIp + ":" + wsPort
|
|
active: true
|
|
|
|
onStatusChanged: {
|
|
if(status === WebSocket.Closed || status === WebSocket.Error) {
|
|
Common.wsocketClosed();
|
|
}
|
|
}
|
|
|
|
onBinaryMessageReceived: {
|
|
let arrayBuffer = new Float32Array(message);
|
|
Common.audioDataUpdated(arrayBuffer.slice());
|
|
}
|
|
}
|