mirror of
https://github.com/samirkumardas/pcm-player.git
synced 2025-04-11 04:41:23 +02:00
server example sample bytes added
This commit is contained in:
parent
556104a3e8
commit
cc54870c99
2 changed files with 4 additions and 3 deletions
|
@ -12,7 +12,7 @@
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
var socketURL = 'ws://localhost:8080';
|
var socketURL = 'ws://localhost:8080';
|
||||||
var player = new PCMPlayer({
|
var player = new PCMPlayer({
|
||||||
encoding: '32bitFloat',
|
encoding: '16bitInt',
|
||||||
channels: 2,
|
channels: 2,
|
||||||
sampleRate: 8000,
|
sampleRate: 8000,
|
||||||
flushingTime: 2000
|
flushingTime: 2000
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue