|
|
@ -1,11 +1,12 @@
|
|
|
|
const WebSocket = require('ws');
|
|
|
|
const WebSocket = require('ws');
|
|
|
|
const fs = require('fs');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
|
|
|
|
|
|
|
const pcm_file = './32bit (float)-8000.raw';
|
|
|
|
const pcm_file = './16bit-8000.raw';
|
|
|
|
let interval = 0,
|
|
|
|
let interval = 0,
|
|
|
|
sampleRate = 8000,
|
|
|
|
sampleRate = 8000,
|
|
|
|
|
|
|
|
bytePerSample = 2,
|
|
|
|
channels = 2,
|
|
|
|
channels = 2,
|
|
|
|
bytesChunk = (sampleRate * channels),
|
|
|
|
bytesChunk = (sampleRate * bytePerSample * channels),
|
|
|
|
offset = 0,
|
|
|
|
offset = 0,
|
|
|
|
pcmData,
|
|
|
|
pcmData,
|
|
|
|
wss;
|
|
|
|
wss;
|
|
|
|