Spaces:
No application file
No application file
constinic@gmail.com commited on
Commit ·
bf4cdcf
1
Parent(s): 662d11f
commits
Browse files
client.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
const dgram = require('dgram');
|
| 4 |
-
const { client } = require("@gradio/client");
|
| 5 |
-
|
| 6 |
-
const app = client("https://dprogrammer-tts-vrc.hf.space/--replicas/xsp7c/", hf_token="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",
|
| 7 |
-
output_dir='D:\\vrc to tts\\audios')
|
| 8 |
-
const UDP_IP = '127.0.0.1'; // IP to listen on
|
| 9 |
-
const UDP_PORT = 5000; // Port to listen on
|
| 10 |
-
|
| 11 |
-
const udpServer = dgram.createSocket('udp4');
|
| 12 |
-
|
| 13 |
-
udpServer.on('listening', () => {
|
| 14 |
-
const address = udpServer.address();
|
| 15 |
-
console.log(`UDP server listening on ${address.address}:${address.port}`);
|
| 16 |
-
});
|
| 17 |
-
|
| 18 |
-
udpServer.on('message', (msg, info) => {
|
| 19 |
-
const receivedMessage = msg.toString('utf8');
|
| 20 |
-
console.log(`Received UDP message: ${receivedMessage}`);
|
| 21 |
-
app.predict("/tts",["mikuDefault",1,"hola soy la miku javascript","es-AR-ElenaNeural-Female",7,"pm",0,0])
|
| 22 |
-
// Send confirmation message back to the sender's address and port
|
| 23 |
-
const confirmationMessage = 'Message received successfully';
|
| 24 |
-
udpServer.send(Buffer.from(confirmationMessage), 8080, info.address, (err) => {
|
| 25 |
-
if (err) {
|
| 26 |
-
console.error('Error sending response:', err);
|
| 27 |
-
} else {
|
| 28 |
-
console.log(`Confirmation message sent to ${info.address}:${info.port}`);
|
| 29 |
-
}
|
| 30 |
-
});
|
| 31 |
-
});
|
| 32 |
-
|
| 33 |
-
udpServer.on('error', (err) => {
|
| 34 |
-
console.error('UDP server error:', err);
|
| 35 |
-
});
|
| 36 |
-
|
| 37 |
-
udpServer.bind(UDP_PORT, UDP_IP);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
client.py
CHANGED
|
@@ -46,7 +46,7 @@ print(result)
|
|
| 46 |
# udp_socket.bind((UDP_IP, UDP_PORT))
|
| 47 |
|
| 48 |
# # client = Client("http://127.0.0.1:7860")
|
| 49 |
-
# client = Client("https://dprogrammer-tts-vrc.hf.space/--replicas/5bwrc/",
|
| 50 |
# output_dir='D:\\vrc to tts\\audios')
|
| 51 |
# def chat(message):
|
| 52 |
# result = client.predict(
|
|
|
|
| 46 |
# udp_socket.bind((UDP_IP, UDP_PORT))
|
| 47 |
|
| 48 |
# # client = Client("http://127.0.0.1:7860")
|
| 49 |
+
# client = Client("https://dprogrammer-tts-vrc.hf.space/--replicas/5bwrc/", ,
|
| 50 |
# output_dir='D:\\vrc to tts\\audios')
|
| 51 |
# def chat(message):
|
| 52 |
# result = client.predict(
|