server example sample bytes added

pull/14/head
Samir 7 years ago
parent 556104a3e8
commit cc54870c99

@ -12,7 +12,7 @@
window.onload = function() {
var socketURL = 'ws://localhost:8080';
var player = new PCMPlayer({
encoding: '32bitFloat',
encoding: '16bitInt',
channels: 2,
sampleRate: 8000,
flushingTime: 2000

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

Loading…
Cancel
Save