Coder Social home page Coder Social logo

samirkumardas / opus-to-pcm Goto Github PK

View Code? Open in Web Editor NEW
70.0 6.0 15.0 2.05 MB

Decode raw opus packet to PCM without using any external library in your browser.

License: Other

HTML 5.97% JavaScript 94.03%
opus pcm audiocontext decodeaudiodata libopus opus-tools raw-opus-packet opus-to-pcm opus-browser javascript

opus-to-pcm's Introduction

Hi there 👋

Zlienqwe's github stats

Top Langs

opus-to-pcm's People

Contributors

adambailey- avatar dependabot[bot] avatar paulosoaresvieira avatar samirkumardas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opus-to-pcm's Issues

Opus decoder.on("decode",... never executed.

server.html

<!doctype html>
<html>
	<head>
		<script src="https://unpkg.com/[email protected]/dist/peerjs.min.js"></script>
	</head>
	<body>
		<script>
			var peer = new Peer("epalxeis");
			
			var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
			peer.on('call', function(call) {
			  getUserMedia({video: false, audio: true}, function(stream) {
				call.answer(stream); // Answer the call with an A/V stream.
				call.on('stream', function(remoteStream) {
				  // Show stream in some video/canvas element.
				});
			  }, function(err) {
				console.log('Failed to get local stream' ,err);
			  });
			});
					
		</script>

	</body>
</html>

client.html

<!doctype html>
<html>
	<head>
		
		<script src="https://unpkg.com/[email protected]/dist/peerjs.min.js"></script>
		<script type="text/javascript" src="dist/opus_to_pcm.js"></script>
	<script type="text/javascript" src="example/player/pcm_player.js"></script>
	</head>
	<body>
		<script>
			var decoder;
		
			var peer = new Peer();
			var record = false;
			var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
			getUserMedia({video: false, audio: true}, function(stream) {
			  var call = peer.call('epalxeis', stream);
			  call.on('stream', function(remoteStream) {
				// Show stream in some video/canvas element.
				if(record==false){
					var audio = document.createElement("audio");
					audio.srcObject = remoteStream;
					document.body.appendChild(audio);
					audio.play();
					audio.muted = true;
					var epalxeis_audio = document.getElementById("epalxeis_audio");
					record=true;
					var options = {mimeType: "audio/webm;codecs=opus"};
					var recorder = new MediaRecorder(remoteStream,options);
					// fires every one second and passes an BlobEvent
					
					recorder.ondataavailable = event => {

						// get the Blob from the event
						var blob = event.data;
						
						decoder = new OpusToPCM({
						  channels: 1,
						  fallback: false,
						});
						
						
						
						// Assign function to decode callback
						decoder.on('decode', function(pcmData) {

							console.log("123");

						});
						
						
						
						// New file 
						var reader = new FileReader();

						// Assign callback
						reader.onload = function(){
							var audioBuffer = new Int16Array(reader.result);
							decoder.decode(audioBuffer);
						}

						// Read data into file reader (will start the onload function above)
						reader.readAsArrayBuffer(event.data);
												
						
					};

					// make data available event fire every one second
					recorder.start(5000);
				}
				
			  });
			}, function(err) {
			  console.log('Failed to get local stream' ,err);
			});
					
		</script>

	</body>
	<audio id="epalxeis_audio"></audio>
	
</html>

Problem: decoder.on("decode",... callback function never executed.

TypeScript definitions

Is there any plan to add to typescript definitions or typescript examples for this project?
It will be really useful if there are any typescript definitions for the main OpustoPCM class and its related functions

Also, I ran the example server and client that was present in the repo (with some of the raw_opus sample files), and I got this error

The buffer passed to decodeAudioData contains invalid content which cannot be decoded successfully.
EncodingError: The given encoding is not supported.

I don't think I changed anything with respect to the code in the example. I just translated to the code to use TypeScript syntax wherever possible. I am not sure if the error was because of unknown typing definitions, or its because of something else.

Delay in playback

Hello! I'm currently working on audio decoding with Websocket. So far, I've decode the opus packet successfully, but the voices was off and on, how to resolve the problem? For example to set a buffer area to play. I'm sorry my English is not very good, If you see it, please give me a reply. Thank you

connection to 'ws://localhost:8080/' failed

Thanks. Great Projects !!!
But I am getting:
WebSocket connection to 'ws://localhost:8080/' failed: --- in Chrome
and
Firefox can’t establish a connection to the server at ws://localhost:8080/. ---- in Firefox
when attempting to run the example.html on the line:
var ws = new WebSocket(socketURL);
Can you help?

Error: corrupted stream

Hello,

trying to implement your library, but got these errors:
Снимок экрана 2019-07-28 в 13 39 25

Here is a stringified version of one of the chunks that causing a problem:

{"0":79,"1":103,"2":103,"3":83,"4":0,"5":0,"6":0,"7":216,"8":114,"9":0,"10":0,"11":0,"12":0,"13":0,"14":125,"15":198,"16":140,"17":115,"18":197,"19":0,"20":0,"21":0,"22":112,"23":233,"24":123,"25":120,"26":40,"27":123,"28":133,"29":109,"30":126,"31":122,"32":142,"33":131,"34":128,"35":118,"36":124,"37":120,"38":117,"39":127,"40":131,"41":132,"42":134,"43":134,"44":131,"45":122,"46":122,"47":123,"48":121,"49":116,"50":112,"51":122,"52":118,"53":125,"54":116,"55":111,"56":103,"57":99,"58":105,"59":99,"60":101,"61":103,"62":96,"63":94,"64":91,"65":98,"66":102,"67":120,"68":134,"69":173,"70":166,"71":80,"72":180,"73":231,"74":74,"75":223,"76":232,"77":199,"78":15,"79":92,"80":6,"81":208,"82":86,"83":236,"84":20,"85":166,"86":147,"87":146,"88":86,"89":252,"90":0,"91":194,"92":139,"93":245,"94":199,"95":54,"96":177,"97":193,"98":101,"99":25,"100":73,"101":9,"102":97,"103":236,"104":7,"105":114,"106":220,"107":11,"108":189,"109":207,"110":232,"111":91,"112":160,"113":104,"114":47,"115":80,"116":214,"117":105,"118":212,"119":34,"120":172,"121":215,"122":220,"123":52,"124":106,"125":179,"126":15,"127":81,"128":97,"129":61,"130":154,"131":115,"132":12,"133":51,"134":215,"135":143,"136":54,"137":212,"138":132,"139":198,"140":241,"141":217,"142":166,"143":150,"144":254,"145":189,"146":19,"147":145,"148":247,"149":11,"150":234,"151":185,"152":36,"153":217,"154":138,"155":207,"156":109,"157":79,"158":157,"159":209,"160":139,"161":103,"162":181,"163":255,"164":4,"165":95,"166":5,"167":25,"168":9,"169":120,"170":133,"171":20,"172":210,"173":31,"174":113,"175":49,"176":200,"177":76,"178":89,"179":22,"180":62,"181":55,"182":109,"183":183,"184":57,"185":5,"186":248,"187":234,"188":189,"189":7,"190":120,"191":128,"192":61,"193":63,"194":86,"195":211,"196":169,"197":161,"198":246,"199":225,"200":67,"201":219,"202":145,"203":232,"204":17,"205":141,"206":10,"207":36,"208":13,"209":102,"210":0,"211":225,"212":107,"213":18,"214":99,"215":184,"216":84,"217":154,"218":138,"219":208,"220":253,"221":3,"222":76,"223":147,"224":225,"225":173,"226":24,"227":149,"228":79,"229":42,"230":127,"231":230,"232":65,"233":17,"234":73,"235":46,"236":219,"237":206,"238":3,"239":215,"240":152,"241":77,"242":46,"243":205,"244":232,"245":246,"246":251,"247":18,"248":33,"249":81,"250":166,"251":139,"252":226,"253":144,"254":254,"255":130,"256":251,"257":95,"258":140,"259":245,"260":249,"261":235,"262":20,"263":230,"264":189,"265":240,"266":149,"267":52,"268":218,"269":127,"270":199,"271":215,"272":238,"273":16,"274":244,"275":187,"276":124,"277":93,"278":151,"279":111,"280":212,"281":228,"282":28,"283":180,"284":22,"285":241,"286":28,"287":59,"288":248,"289":67,"290":86,"291":105,"292":121,"293":126,"294":207,"295":7,"296":176,"297":234,"298":45,"299":202,"300":146,"301":205,"302":21,"303":152,"304":72,"305":255,"306":56,"307":181,"308":235,"309":207,"310":162,"311":63,"312":70,"313":219,"314":34,"315":20,"316":200,"317":61,"318":221,"319":19,"320":56,"321":224,"322":148,"323":120,"324":131,"325":162,"326":0,"327":203,"328":236,"329":54,"330":223,"331":212,"332":142,"333":201,"334":88,"335":44,"336":16,"337":95,"338":191,"339":254,"340":184,"341":106,"342":232,"343":114,"344":46,"345":128,"346":192,"347":127,"348":112,"349":126,"350":133,"351":94,"352":49,"353":238,"354":115,"355":81,"356":149,"357":221,"358":182,"359":224,"360":61,"361":212,"362":241,"363":117,"364":83,"365":129,"366":48,"367":58,"368":208,"369":18,"370":241,"371":69,"372":150,"373":193,"374":163,"375":39,"376":83,"377":239,"378":174,"379":104,"380":41,"381":39,"382":205,"383":6,"384":7,"385":162,"386":218,"387":122,"388":182,"389":131,"390":54,"391":124,"392":0,"393":176,"394":64,"395":174,"396":120,"397":16,"398":126,"399":238,"400":251,"401":88,"402":203,"403":185,"404":0,"405":115,"406":189,"407":204,"408":250,"409":165,"410":252,"411":67,"412":239,"413":87,"414":140,"415":234,"416":41,"417":227,"418":141,"419":252,"420":34,"421":197,"422":188,"423":80,"424":50,"425":97,"426":13,"427":76,"428":125,"429":107,"430":141,"431":211,"432":120,"433":139,"434":195,"435":2,"436":119,"437":156,"438":179,"439":144,"440":160,"441":84,"442":39,"443":229,"444":91,"445":148,"446":67,"447":67,"448":139,"449":88,"450":26,"451":64,"452":212,"453":235,"454":116,"455":137,"456":73,"457":35,"458":248,"459":89,"460":148,"461":250,"462":20,"463":1,"464":1,"465":26,"466":89,"467":191,"468":112,"469":201,"470":38,"471":112,"472":207,"473":103,"474":194,"475":213,"476":164,"477":5,"478":33,"479":33,"480":199,"481":69,"482":151,"483":42,"484":41,"485":20,"486":171,"487":146,"488":99,"489":238,"490":135,"491":87,"492":215,"493":23,"494":186,"495":184,"496":217,"497":35,"498":72,"499":108,"500":10,"501":114,"502":94,"503":91,"504":139,"505":202,"506":46,"507":245,"508":182,"509":117,"510":125,"511":236,"512":197,"513":252,"514":13,"515":101,"516":165,"517":40,"518":85,"519":178,"520":200,"521":120,"522":103,"523":29,"524":228,"525":5,"526":167,"527":202,"528":25,"529":159,"530":132,"531":243,"532":188,"533":176,"534":59,"535":233,"536":138,"537":54,"538":233,"539":182,"540":223,"541":102,"542":160,"543":252,"544":145,"545":132,"546":27,"547":58,"548":98,"549":149,"550":170,"551":246,"552":144,"553":15,"554":33,"555":142,"556":57,"557":206,"558":120,"559":137,"560":114,"561":19,"562":46,"563":150,"564":157,"565":25,"566":180,"567":75,"568":237,"569":181,"570":66,"571":190,"572":48,"573":90,"574":123,"575":51,"576":177,"577":16,"578":138,"579":102,"580":226,"581":40,"582":118,"583":165,"584":119,"585":18,"586":241,"587":217,"588":221,"589":59,"590":119,"591":108,"592":171,"593":41,"594":39,"595":85,"596":21,"597":192,"598":209,"599":216,"600":141,"601":185,"602":3,"603":244,"604":133,"605":60,"606":143,"607":130,"608":235,"609":178,"610":142,"611":62,"612":179,"613":137,"614":241,"615":252,"616":6,"617":96,"618":171,"619":0,"620":102,"621":211,"622":232,"623":142,"624":26,"625":144,"626":36,"627":154,"628":44,"629":123,"630":73,"631":108,"632":96,"633":19,"634":132,"635":241,"636":221,"637":209,"638":25,"639":237,"640":136,"641":103,"642":22,"643":222,"644":91,"645":21,"646":57,"647":248,"648":83,"649":197,"650":80,"651":165,"652":65,"653":191,"654":181,"655":216,"656":185,"657":37,"658":13,"659":194,"660":226,"661":81,"662":138,"663":28,"664":182,"665":217,"666":160,"667":12,"668":195,"669":64,"670":120,"671":41,"672":189,"673":181,"674":71,"675":20,"676":97,"677":18,"678":56,"679":25,"680":120,"681":128,"682":154,"683":61,"684":81,"685":178,"686":185,"687":81,"688":219,"689":89,"690":2,"691":122,"692":245,"693":240,"694":80,"695":191,"696":43,"697":35,"698":201,"699":65,"700":165,"701":239,"702":163,"703":96,"704":77,"705":122,"706":33,"707":92,"708":21,"709":60,"710":11,"711":142,"712":69,"713":56,"714":156,"715":30,"716":59,"717":82,"718":106,"719":199,"720":196,"721":79,"722":24,"723":148,"724":6,"725":207,"726":54,"727":146,"728":206,"729":1,"730":227,"731":94,"732":223,"733":99,"734":18,"735":215,"736":98,"737":165,"738":149,"739":212,"740":210,"741":142,"742":139,"743":201,"744":187,"745":173,"746":239,"747":152,"748":168,"749":186,"750":165,"751":0,"752":24,"753":10,"754":231,"755":178,"756":61,"757":73,"758":169,"759":136,"760":234,"761":202,"762":112,"763":32,"764":172,"765":171,"766":89,"767":68,"768":230,"769":33,"770":57,"771":182,"772":136,"773":202,"774":184,"775":171,"776":49,"777":237,"778":39,"779":140,"780":231,"781":229,"782":157,"783":62,"784":184,"785":231,"786":47,"787":96,"788":184,"789":0,"790":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"797":0,"798":109,"799":5,"800":235,"801":187,"802":17,"803":231,"804":243,"805":154,"806":41,"807":14,"808":62,"809":97,"810":230,"811":192,"812":94,"813":40,"814":207,"815":210,"816":127,"817":229,"818":36,"819":116,"820":6,"821":146,"822":120,"823":131,"824":162,"825":0,"826":69,"827":194,"828":155,"829":239,"830":171,"831":237,"832":126,"833":188,"834":245,"835":4,"836":221,"837":23,"838":218,"839":161,"840":176,"841":90,"842":71,"843":65,"844":220,"845":134,"846":154,"847":243,"848":32,"849":182,"850":47,"851":154,"852":87,"853":13,"854":33,"855":201,"856":113,"857":118,"858":135,"859":58,"860":88,"861":89,"862":54,"863":51,"864":214,"865":176,"866":219,"867":32,"868":231,"869":168,"870":240,"871":121,"872":231,"873":213,"874":144,"875":162,"876":83,"877":43,"878":52,"879":139,"880":198,"881":217,"882":210,"883":193,"884":170,"885":244,"886":201,"887":2,"888":57,"889":127,"890":111,"891":255,"892":6,"893":68,"894":28,"895":231,"896":79,"897":192,"898":84,"899":244,"900":93,"901":250,"902":23,"903":250,"904":218,"905":219,"906":77,"907":29,"908":93,"909":218,"910":24,"911":227,"912":183,"913":139,"914":6,"915":120,"916":200,"917":10,"918":207,"919":214,"920":151,"921":28,"922":190,"923":143,"924":76,"925":116,"926":231,"927":115,"928":248,"929":33,"930":76,"931":65,"932":98,"933":17,"934":231,"935":110,"936":91,"937":115,"938":117,"939":213,"940":92,"941":176,"942":224,"943":201,"944":205,"945":105,"946":91,"947":115,"948":84,"949":24,"950":105,"951":190,"952":123,"953":120,"954":139,"955":78,"956":69,"957":159,"958":212,"959":52,"960":178,"961":30,"962":92,"963":31,"964":120,"965":10,"966":247,"967":78,"968":85,"969":66,"970":60,"971":127,"972":72,"973":205,"974":243,"975":183,"976":114,"977":160,"978":143,"979":139,"980":164,"981":207,"982":2,"983":153,"984":184,"985":162,"986":112,"987":14,"988":247,"989":197,"990":174,"991":11,"992":217,"993":63,"994":255,"995":122,"996":188,"997":40,"998":82,"999":189,"1000":106,"1001":129,"1002":130,"1003":143,"1004":170,"1005":131,"1006":174,"1007":43,"1008":34,"1009":90,"1010":86,"1011":20,"1012":144,"1013":24,"1014":224,"1015":68,"1016":213,"1017":41,"1018":204,"1019":54,"1020":113,"1021":124,"1022":224,"1023":189,"1024":65,"1025":1,"1026":12,"1027":217,"1028":42,"1029":20,"1030":225,"1031":162,"1032":193,"1033":68,"1034":210,"1035":189,"1036":52,"1037":140,"1038":194,"1039":168,"1040":118,"1041":115,"1042":85,"1043":54,"1044":213,"1045":133,"1046":124,"1047":188,"1048":218,"1049":231,"1050":110,"1051":32,"1052":83,"1053":78,"1054":220,"1055":158,"1056":114,"1057":0,"1058":50,"1059":255,"1060":121,"1061":96,"1062":232,"1063":253,"1064":137,"1065":133,"1066":73,"1067":184,"1068":174,"1069":9,"1070":74,"1071":133,"1072":130,"1073":165,"1074":168,"1075":247,"1076":63,"1077":65,"1078":48,"1079":131,"1080":173,"1081":120,"1082":137,"1083":116,"1084":129,"1085":157,"1086":3,"1087":46,"1088":25,"1089":197,"1090":15,"1091":97,"1092":51,"1093":181,"1094":217,"1095":174,"1096":130,"1097":174,"1098":169,"1099":202,"1100":123,"1101":44,"1102":146,"1103":144,"1104":21,"1105":171,"1106":107,"1107":242,"1108":3,"1109":27,"1110":62,"1111":151,"1112":211,"1113":119,"1114":71,"1115":167,"1116":41,"1117":61,"1118":71,"1119":160,"1120":35,"1121":47,"1122":65,"1123":19,"1124":82,"1125":6,"1126":129,"1127":85,"1128":81,"1129":48,"1130":24,"1131":136,"1132":241,"1133":190,"1134":64,"1135":244,"1136":73,"1137":63,"1138":55,"1139":242,"1140":224,"1141":29,"1142":24,"1143":179,"1144":193,"1145":16,"1146":57,"1147":27,"1148":143,"1149":248,"1150":228,"1151":59,"1152":17,"1153":58,"1154":158,"1155":47,"1156":60,"1157":46,"1158":153,"1159":144,"1160":116,"1161":44,"1162":224,"1163":49,"1164":83,"1165":131,"1166":52,"1167":87,"1168":105,"1169":59,"1170":99,"1171":52,"1172":200,"1173":116,"1174":70,"1175":212,"1176":181,"1177":233,"1178":93,"1179":45,"1180":236,"1181":67,"1182":194,"1183":139,"1184":149,"1185":54,"1186":50,"1187":77,"1188":21,"1189":205,"1190":246,"1191":155,"1192":161,"1193":132,"1194":163,"1195":211,"1196":250,"1197":20,"1198":31,"1199":120,"1200":136,"1201":97,"1202":40,"1203":164,"1204":19,"1205":69,"1206":141,"1207":226,"1208":58,"1209":176,"1210":235,"1211":191,"1212":123,"1213":17,"1214":227,"1215":90,"1216":207,"1217":69,"1218":211,"1219":56,"1220":131,"1221":122,"1222":71,"1223":26,"1224":249,"1225":33,"1226":66,"1227":130,"1228":240,"1229":93,"1230":123,"1231":164,"1232":135,"1233":27,"1234":26,"1235":206,"1236":183,"1237":105,"1238":170,"1239":174,"1240":214,"1241":53,"1242":176,"1243":190,"1244":87,"1245":155,"1246":54,"1247":193,"1248":191,"1249":68,"1250":134,"1251":233,"1252":121,"1253":102,"1254":249,"1255":198,"1256":176,"1257":86,"1258":64,"1259":0,"1260":37,"1261":186,"1262":158,"1263":89,"1264":249,"1265":73,"1266":177,"1267":249,"1268":83,"1269":155,"1270":111,"1271":152,"1272":198,"1273":92,"1274":134,"1275":158,"1276":90,"1277":87,"1278":198,"1279":67,"1280":78,"1281":13,"1282":224,"1283":221,"1284":185,"1285":15,"1286":69,"1287":21,"1288":163,"1289":229,"1290":0,"1291":127,"1292":207,"1293":130,"1294":161,"1295":29,"1296":132,"1297":2,"1298":95,"1299":238,"1300":73,"1301":104,"1302":84,"1303":19,"1304":116,"1305":190,"1306":97,"1307":8,"1308":49,"1309":68,"1310":230,"1311":74,"1312":192,"1313":65,"1314":184,"1315":212,"1316":52,"1317":8,"1318":137,"1319":164,"1320":255,"1321":218,"1322":110,"1323":120,"1324":136,"1325":95,"1326":79,"1327":20,"1328":46,"1329":34,"1330":220,"1331":203,"1332":79,"1333":155,"1334":96,"1335":84,"1336":120,"1337":102,"1338":243,"1339":216,"1340":131,"1341":36,"1342":96,"1343":171,"1344":82,"1345":118,"1346":182,"1347":232,"1348":54,"1349":234,"1350":219,"1351":142,"1352":180,"1353":234,"1354":175,"1355":27,"1356":211,"1357":201,"1358":173,"1359":152,"1360":90,"1361":254,"1362":52,"1363":209,"1364":4,"1365":230,"1366":235,"1367":10,"1368":76,"1369":192,"1370":132,"1371":89,"1372":33,"1373":13,"1374":227,"1375":223,"1376":41,"1377":23,"1378":204,"1379":101,"1380":116,"1381":124,"1382":91,"1383":75,"1384":1,"1385":111,"1386":140,"1387":120,"1388":111,"1389":241,"1390":198,"1391":174,"1392":92,"1393":244,"1394":4,"1395":234,"1396":83,"1397":165,"1398":40,"1399":225,"1400":226,"1401":216,"1402":133,"1403":178,"1404":44,"1405":73,"1406":35,"1407":71,"1408":16,"1409":251,"1410":75,"1411":35,"1412":136,"1413":179,"1414":227,"1415":49,"1416":134,"1417":225,"1418":83,"1419":136,"1420":133,"1421":190,"1422":45,"1423":21,"1424":139,"1425":118,"1426":123,"1427":147,"1428":145,"1429":127,"1430":44,"1431":56,"1432":127,"1433":138,"1434":204,"1435":20,"1436":74,"1437":128,"1438":175,"1439":136,"1440":10,"1441":37,"1442":210,"1443":120,"1444":136,"1445":97,"1446":50,"1447":193,"1448":78,"1449":44,"1450":80,"1451":106,"1452":247,"1453":51,"1454":206,"1455":130,"1456":23,"1457":172,"1458":213,"1459":168,"1460":221,"1461":74,"1462":169,"1463":249,"1464":133,"1465":242,"1466":158,"1467":147,"1468":193,"1469":211,"1470":141,"1471":53,"1472":71,"1473":94,"1474":205,"1475":151,"1476":79,"1477":29,"1478":44,"1479":168,"1480":47,"1481":214,"1482":77,"1483":245,"1484":220,"1485":127,"1486":34,"1487":212,"1488":156,"1489":16,"1490":167,"1491":4,"1492":186,"1493":163,"1494":169,"1495":25,"1496":217,"1497":247,"1498":27,"1499":121,"1500":183,"1501":238,"1502":130,"1503":136,"1504":16,"1505":80,"1506":11,"1507":42,"1508":3,"1509":191,"1510":226,"1511":221,"1512":245,"1513":5,"1514":163,"1515":138,"1516":135,"1517":200,"1518":54,"1519":228,"1520":152,"1521":127,"1522":52,"1523":174,"1524":11,"1525":50,"1526":212,"1527":205,"1528":127,"1529":17,"1530":207,"1531":32,"1532":145,"1533":70,"1534":52,"1535":136,"1536":239,"1537":76,"1538":174,"1539":104,"1540":141,"1541":99,"1542":130,"1543":255,"1544":15,"1545":66,"1546":41,"1547":29,"1548":162,"1549":182,"1550":69,"1551":34,"1552":196,"1553":229,"1554":67,"1555":151,"1556":225,"1557":180,"1558":178,"1559":20,"1560":120,"1561":136,"1562":61,"1563":148,"1564":130,"1565":219,"1566":18,"1567":159,"1568":194,"1569":103,"1570":140,"1571":118,"1572":95,"1573":145,"1574":42,"1575":255,"1576":190,"1577":1,"1578":176,"1579":37,"1580":134,"1581":15,"1582":16,"1583":86,"1584":110,"1585":183,"1586":130,"1587":233,"1588":6,"1589":239,"1590":253,"1591":246,"1592":39,"1593":226,"1594":171,"1595":182,"1596":52,"1597":1,"1598":161,"1599":127,"1600":98,"1601":166,"1602":113,"1603":239,"1604":5,"1605":47,"1606":29,"1607":177,"1608":84,"1609":86,"1610":45,"1611":145,"1612":18,"1613":20,"1614":88,"1615":222,"1616":136,"1617":134,"1618":95,"1619":249,"1620":95,"1621":105,"1622":238,"1623":142,"1624":49,"1625":244,"1626":168,"1627":247,"1628":19,"1629":85,"1630":46,"1631":229,"1632":102,"1633":237,"1634":200,"1635":167,"1636":41,"1637":234,"1638":88,"1639":169,"1640":34,"1641":147,"1642":235,"1643":233,"1644":223,"1645":149,"1646":41,"1647":223,"1648":108,"1649":23,"1650":27,"1651":221,"1652":187,"1653":71,"1654":137,"1655":75,"1656":247,"1657":165,"1658":1,"1659":123,"1660":52,"1661":14,"1662":82,"1663":144,"1664":173,"1665":23,"1666":151,"1667":162,"1668":44,"1669":73,"1670":115,"1671":242,"1672":95,"1673":225,"1674":117,"1675":197,"1676":15,"1677":105,"1678":176,"1679":107,"1680":244,"1681":85,"1682":248,"1683":150,"1684":100,"1685":240,"1686":106,"1687":120,"1688":136,"1689":127,"1690":71,"1691":209,"1692":238,"1693":252,"1694":224,"1695":204,"1696":48,"1697":156,"1698":251,"1699":120,"1700":14,"1701":182,"1702":80,"1703":247,"1704":217,"1705":136,"1706":222,"1707":87,"1708":184,"1709":52,"1710":103,"1711":116,"1712":32,"1713":177,"1714":253,"1715":120,"1716":82,"1717":155,"1718":34,"1719":187,"1720":109,"1721":50,"1722":214,"1723":191,"1724":198,"1725":205,"1726":51,"1727":212,"1728":180,"1729":33,"1730":217,"1731":114,"1732":67,"1733":247,"1734":84,"1735":66,"1736":27,"1737":91,"1738":221,"1739":150,"1740":239,"1741":102,"1742":16,"1743":181,"1744":79,"1745":141,"1746":136,"1747":244,"1748":125,"1749":108,"1750":165,"1751":223,"1752":171,"1753":25,"1754":51,"1755":148,"1756":49,"1757":252,"1758":22,"1759":96,"1760":80,"1761":94,"1762":120,"1763":28,"1764":109,"1765":33,"1766":244,"1767":79,"1768":109,"1769":244,"1770":168,"1771":169,"1772":29,"1773":191,"1774":137,"1775":7,"1776":157,"1777":187,"1778":16,"1779":197,"1780":2,"1781":231,"1782":32,"1783":40,"1784":142,"1785":28,"1786":180,"1787":143,"1788":160,"1789":5,"1790":15,"1791":232,"1792":164,"1793":70,"1794":93,"1795":59,"1796":85,"1797":145,"1798":180,"1799":135,"1800":178,"1801":25,"1802":249,"1803":90,"1804":148,"1805":65,"1806":198,"1807":11,"1808":28,"1809":69,"1810":51,"1811":222,"1812":12,"1813":197,"1814":237,"1815":239,"1816":38,"1817":26,"1818":120,"1819":137,"1820":81,"1821":172,"1822":39,"1823":170,"1824":84,"1825":78,"1826":200,"1827":84,"1828":184,"1829":23,"1830":36,"1831":27,"1832":100,"1833":75,"1834":131,"1835":89,"1836":193,"1837":50,"1838":104,"1839":187,"1840":172,"1841":47,"1842":199,"1843":233,"1844":43,"1845":218,"1846":90,"1847":202,"1848":21,"1849":235,"1850":113,"1851":255,"1852":100,"1853":231,"1854":82,"1855":235,"1856":37,"1857":138,"1858":178,"1859":154,"1860":64,"1861":36,"1862":92,"1863":127,"1864":16,"1865":212,"1866":122,"1867":11,"1868":187,"1869":137,"1870":233,"1871":224,"1872":196,"1873":176,"1874":45,"1875":106,"1876":128,"1877":245,"1878":10,"1879":154,"1880":232,"1881":124,"1882":237,"1883":84,"1884":151,"1885":162,"1886":32,"1887":246,"1888":67,"1889":108,"1890":83,"1891":94,"1892":188,"1893":252,"1894":3,"1895":90,"1896":152,"1897":20,"1898":197,"1899":24,"1900":89,"1901":243,"1902":16,"1903":36,"1904":146,"1905":198,"1906":231,"1907":145,"1908":83,"1909":216,"1910":89,"1911":71,"1912":74,"1913":190,"1914":76,"1915":196,"1916":183,"1917":63,"1918":233,"1919":97,"1920":78,"1921":209,"1922":187,"1923":146,"1924":212,"1925":194,"1926":224,"1927":84,"1928":151,"1929":228,"1930":3,"1931":218,"1932":62,"1933":52,"1934":251,"1935":95,"1936":93,"1937":226,"1938":58,"1939":4,"1940":40,"1941":87,"1942":115,"1943":174,"1944":128,"1945":254,"1946":27,"1947":105,"1948":123,"1949":37,"1950":120,"1951":139,"1952":13,"1953":16,"1954":81,"1955":138,"1956":27,"1957":91,"1958":90,"1959":83,"1960":21,"1961":205,"1962":163,"1963":132,"1964":193,"1965":181,"1966":167,"1967":99,"1968":212,"1969":178,"1970":43,"1971":187,"1972":136,"1973":127,"1974":220,"1975":55,"1976":179,"1977":120,"1978":119,"1979":116,"1980":175,"1981":238,"1982":173,"1983":12,"1984":174,"1985":178,"1986":66,"1987":214,"1988":152,"1989":179,"1990":206,"1991":85,"1992":113,"1993":114,"1994":112,"1995":21,"1996":150,"1997":62,"1998":163,"1999":222,"2000":145,"2001":230,"2002":122,"2003":97,"2004":56,"2005":214,"2006":168,"2007":239,"2008":223,"2009":152,"2010":241,"2011":79,"2012":12,"2013":65,"2014":129,"2015":232,"2016":107,"2017":55,"2018":255,"2019":225,"2020":233,"2021":27,"2022":165,"2023":125,"2024":238,"2025":36,"2026":213,"2027":144,"2028":11,"2029":177,"2030":175,"2031":68,"2032":52,"2033":124,"2034":75,"2035":154,"2036":8,"2037":225,"2038":248,"2039":207,"2040":48,"2041":197,"2042":218,"2043":61,"2044":172,"2045":116,"2046":155,"2047":134,"2048":55,"2049":162,"2050":114,"2051":187,"2052":239,"2053":191,"2054":63,"2055":219,"2056":63,"2057":202,"2058":62,"2059":113,"2060":126,"2061":103,"2062":94,"2063":214,"2064":250,"2065":190,"2066":216,"2067":4,"2068":234,"2069":97,"2070":246,"2071":24,"2072":232,"2073":41,"2074":188,"2075":132,"2076":132,"2077":177,"2078":77,"2079":36,"2080":120,"2081":86,"2082":29,"2083":172,"2084":120,"2085":139,"2086":253,"2087":192,"2088":209,"2089":92,"2090":227,"2091":223,"2092":10,"2093":157,"2094":61,"2095":242,"2096":73,"2097":59,"2098":108,"2099":179,"2100":133,"2101":63,"2102":29,"2103":161,"2104":13,"2105":63,"2106":143,"2107":143,"2108":63,"2109":163,"2110":60,"2111":255,"2112":119,"2113":71,"2114":140,"2115":203,"2116":85,"2117":155,"2118":227,"2119":7,"2120":227,"2121":13,"2122":113,"2123":148,"2124":122,"2125":65,"2126":178,"2127":139,"2128":39,"2129":27,"2130":79,"2131":29,"2132":47,"2133":24,"2134":26,"2135":248,"2136":168,"2137":117,"2138":127,"2139":5,"2140":171,"2141":25,"2142":101,"2143":195,"2144":65,"2145":198,"2146":208,"2147":72,"2148":6,"2149":27,"2150":225,"2151":51,"2152":158,"2153":206,"2154":19,"2155":234,"2156":226,"2157":127,"2158":217,"2159":24,"2160":118,"2161":73,"2162":122,"2163":241,"2164":113,"2165":98,"2166":105,"2167":249,"2168":156,"2169":164,"2170":54,"2171":147,"2172":112,"2173":94,"2174":200,"2175":234,"2176":210,"2177":128,"2178":145,"2179":154,"2180":28,"2181":4,"2182":173,"2183":30,"2184":54,"2185":148,"2186":14,"2187":41,"2188":126,"2189":229,"2190":52,"2191":46,"2192":77,"2193":21,"2194":154,"2195":79,"2196":172,"2197":33,"2198":123,"2199":105,"2200":0,"2201":144,"2202":50,"2203":16,"2204":208,"2205":128,"2206":157,"2207":144,"2208":176,"2209":127,"2210":189,"2211":107,"2212":201,"2213":196,"2214":229,"2215":52,"2216":164,"2217":144,"2218":120,"2219":140,"2220":130,"2221":168,"2222":13,"2223":48,"2224":71,"2225":34,"2226":42,"2227":167,"2228":130,"2229":50,"2230":195,"2231":52,"2232":95,"2233":121,"2234":220,"2235":39,"2236":106,"2237":244,"2238":166,"2239":123,"2240":31,"2241":2,"2242":86,"2243":254,"2244":122,"2245":233,"2246":163,"2247":178,"2248":66,"2249":251,"2250":230,"2251":147,"2252":184,"2253":61,"2254":161,"2255":219,"2256":124,"2257":81,"2258":149,"2259":229,"2260":29,"2261":190,"2262":119,"2263":179,"2264":83,"2265":202,"2266":198,"2267":93,"2268":205,"2269":42,"2270":118,"2271":112,"2272":148,"2273":209,"2274":102,"2275":32,"2276":162,"2277":197,"2278":3,"2279":29,"2280":204,"2281":61,"2282":119,"2283":102,"2284":219,"2285":145,"2286":44,"2287":168,"2288":172,"2289":51,"2290":254,"2291":20,"2292":33,"2293":158,"2294":250,"2295":143,"2296":58,"2297":227,"2298":171,"2299":161,"2300":179,"2301":166,"2302":53,"2303":239,"2304":0,"2305":60,"2306":230,"2307":185,"2308":115,"2309":172,"2310":225,"2311":143,"2312":233,"2313":211,"2314":95,"2315":204,"2316":145,"2317":77,"2318":148,"2319":16,"2320":162,"2321":108,"2322":201,"2323":237,"2324":237,"2325":206,"2326":238,"2327":145,"2328":130,"2329":13,"2330":206,"2331":113,"2332":148,"2333":140,"2334":210,"2335":73,"2336":64,"2337":203,"2338":160,"2339":114,"2340":14,"2341":180,"2342":65,"2343":94,"2344":57,"2345":27,"2346":71,"2347":87,"2348":117,"2349":120,"2350":140,"2351":78,"2352":220,"2353":26,"2354":206,"2355":34,"2356":39,"2357":82,"2358":114,"2359":182,"2360":194,"2361":179,"2362":252,"2363":11,"2364":225,"2365":110,"2366":115,"2367":22,"2368":109,"2369":199,"2370":219,"2371":214,"2372":201,"2373":2,"2374":62,"2375":63,"2376":78,"2377":226,"2378":167,"2379":79,"2380":101,"2381":201,"2382":185,"2383":200,"2384":94,"2385":11,"2386":219,"2387":166,"2388":208,"2389":82,"2390":179,"2391":159,"2392":45,"2393":38,"2394":177,"2395":212,"2396":197,"2397":183,"2398":25,"2399":69,"2400":203,"2401":31,"2402":201,"2403":105,"2404":51,"2405":153,"2406":198,"2407":235,"2408":51,"2409":24,"2410":197,"2411":128,"2412":13,"2413":172,"2414":118,"2415":254,"2416":57,"2417":115,"2418":114,"2419":82,"2420":57,"2421":169,"2422":197,"2423":209,"2424":42,"2425":213,"2426":42,"2427":155,"2428":37,"2429":207,"2430":170,"2431":122,"2432":173,"2433":240,"2434":159,"2435":111,"2436":147,"2437":197,"2438":202,"2439":96,"2440":223,"2441":166,"2442":9,"2443":28,"2444":243,"2445":231,"2446":242,"2447":55,"2448":124,"2449":80,"2450":108,"2451":230,"2452":53,"2453":64,"2454":95,"2455":209,"2456":74,"2457":115,"2458":176,"2459":146,"2460":226,"2461":59,"2462":106,"2463":200,"2464":210,"2465":98,"2466":155,"2467":217,"2468":188,"2469":134,"2470":141,"2471":120,"2472":138,"2473":206,"2474":92,"2475":201,"2476":98,"2477":143,"2478":169,"2479":120,"2480":125,"2481":80,"2482":175,"2483":202,"2484":129,"2485":223,"2486":93,"2487":73,"2488":176,"2489":62,"2490":56,"2491":16,"2492":32,"2493":135,"2494":250,"2495":181,"2496":201,"2497":116,"2498":83,"2499":20,"2500":171,"2501":255,"2502":83,"2503":49,"2504":115,"2505":96,"2506":253,"2507":104,"2508":224,"2509":29,"2510":127,"2511":126,"2512":134,"2513":3,"2514":66,"2515":188,"2516":88,"2517":231,"2518":182,"2519":136,"2520":80,"2521":132,"2522":214,"2523":130,"2524":116,"2525":150,"2526":67,"2527":49,"2528":156,"2529":201,"2530":112,"2531":70,"2532":129,"2533":5,"2534":84,"2535":47,"2536":14,"2537":232,"2538":95,"2539":125,"2540":62,"2541":148,"2542":121,"2543":143,"2544":156,"2545":115,"2546":210,"2547":205,"2548":226,"2549":76,"2550":139,"2551":24,"2552":86,"2553":115,"2554":134,"2555":70,"2556":22,"2557":9,"2558":148,"2559":103,"2560":170,"2561":160,"2562":84,"2563":87,"2564":33,"2565":214,"2566":36,"2567":193,"2568":68,"2569":136,"2570":198,"2571":154,"2572":201,"2573":192,"2574":246,"2575":226,"2576":65,"2577":134,"2578":181,"2579":179,"2580":46,"2581":249,"2582":202,"2583":10,"2584":3,"2585":121,"2586":210,"2587":85,"2588":71,"2589":131,"2590":151,"2591":9,"2592":173,"2593":120,"2594":137,"2595":218,"2596":40,"2597":73,"2598":136,"2599":231,"2600":125,"2601":38,"2602":119,"2603":110,"2604":110,"2605":214,"2606":80,"2607":180,"2608":21,"2609":147,"2610":207,"2611":226,"2612":124,"2613":160,"2614":45,"2615":98,"2616":38,"2617":161,"2618":109,"2619":223,"2620":85,"2621":212,"2622":60,"2623":73,"2624":116,"2625":150,"2626":147,"2627":252,"2628":97,"2629":93,"2630":21,"2631":175,"2632":230,"2633":216,"2634":158,"2635":110,"2636":64,"2637":102,"2638":246,"2639":242,"2640":188,"2641":219,"2642":132,"2643":160,"2644":199,"2645":123,"2646":70,"2647":212,"2648":105,"2649":172,"2650":91,"2651":107,"2652":238,"2653":200,"2654":43,"2655":217,"2656":184,"2657":220,"2658":183,"2659":75,"2660":105,"2661":14,"2662":204,"2663":197,"2664":33,"2665":96,"2666":134,"2667":158,"2668":38,"2669":14,"2670":211,"2671":94,"2672":153,"2673":255,"2674":186,"2675":110,"2676":97,"2677":26,"2678":147,"2679":137,"2680":66,"2681":67,"2682":207,"2683":150,"2684":184,"2685":239,"2686":141,"2687":197,"2688":228,"2689":61,"2690":104,"2691":86,"2692":189,"2693":60,"2694":32,"2695":0,"2696":236,"2697":112,"2698":138,"2699":162,"2700":68,"2701":28,"2702":161,"2703":68,"2704":208,"2705":69,"2706":40,"2707":15,"2708":42,"2709":167,"2710":38,"2711":215,"2712":203,"2713":93,"2714":42,"2715":140,"2716":120,"2717":136,"2718":85,"2719":86,"2720":96,"2721":131,"2722":88,"2723":212,"2724":183,"2725":145,"2726":163,"2727":66,"2728":0,"2729":154,"2730":53,"2731":54,"2732":177,"2733":147,"2734":99,"2735":202,"2736":232,"2737":107,"2738":151,"2739":58,"2740":47,"2741":187,"2742":66,"2743":235,"2744":202,"2745":28,"2746":235,"2747":141,"2748":202,"2749":52,"2750":25,"2751":187,"2752":9,"2753":213,"2754":207,"2755":103,"2756":4,"2757":68,"2758":158,"2759":156,"2760":193,"2761":100,"2762":20,"2763":175,"2764":177,"2765":30,"2766":182,"2767":31,"2768":217,"2769":202,"2770":168,"2771":131,"2772":140,"2773":253,"2774":133,"2775":9,"2776":142,"2777":135,"2778":10,"2779":135,"2780":92,"2781":86,"2782":187,"2783":69,"2784":228,"2785":195,"2786":218,"2787":40,"2788":125,"2789":90,"2790":199,"2791":166,"2792":164,"2793":147,"2794":207,"2795":248,"2796":151,"2797":68,"2798":141,"2799":60,"2800":240,"2801":243,"2802":129,"2803":158,"2804":80,"2805":232,"2806":37,"2807":233,"2808":41,"2809":45,"2810":202,"2811":196,"2812":142,"2813":250,"2814":206,"2815":9,"2816":39,"2817":252,"2818":249,"2819":228,"2820":249,"2821":254,"2822":171,"2823":227,"2824":121,"2825":237,"2826":16,"2827":102,"2828":159,"2829":65,"2830":150,"2831":96,"2832":97,"2833":89,"2834":126,"2835":11,"2836":181,"2837":120,"2838":135,"2839":122,"2840":92,"2841":78,"2842":31,"2843":155,"2844":84,"2845":87,"2846":61,"2847":62,"2848":107,"2849":156,"2850":154,"2851":40,"2852":46,"2853":102,"2854":23,"2855":153,"2856":21,"2857":123,"2858":225,"2859":114,"2860":133,"2861":30,"2862":157,"2863":17,"2864":55,"2865":80,"2866":29,"2867":183,"2868":16,"2869":223,"2870":220,"2871":75,"2872":209,"2873":21,"2874":131,"2875":250,"2876":170,"2877":72,"2878":128,"2879":86,"2880":146,"2881":38,"2882":251,"2883":19,"2884":134,"2885":195,"2886":87,"2887":118,"2888":4,"2889":125,"2890":153,"2891":139,"2892":200,"2893":51,"2894":145,"2895":13,"2896":241,"2897":254,"2898":19,"2899":93,"2900":76,"2901":19,"2902":52,"2903":197,"2904":196,"2905":116,"2906":0,"2907":29,"2908":138,"2909":149,"2910":204,"2911":144,"2912":166,"2913":8,"2914":116,"2915":159,"2916":208,"2917":151,"2918":100,"2919":188,"2920":244,"2921":153,"2922":145,"2923":149,"2924":230,"2925":75,"2926":176,"2927":90,"2928":181,"2929":22,"2930":82,"2931":197,"2932":85,"2933":119,"2934":166,"2935":255,"2936":1,"2937":158,"2938":13,"2939":236,"2940":58,"2941":124,"2942":108,"2943":194,"2944":224,"2945":178,"2946":70,"2947":67,"2948":161,"2949":213,"2950":20,"2951":108,"2952":122,"2953":120,"2954":134,"2955":238,"2956":58,"2957":83,"2958":169,"2959":145,"2960":132,"2961":85,"2962":103,"2963":144,"2964":67,"2965":235,"2966":178,"2967":72,"2968":186,"2969":181,"2970":87,"2971":42,"2972":218,"2973":157,"2974":238,"2975":127,"2976":103,"2977":119,"2978":85,"2979":110,"2980":222,"2981":155,"2982":41,"2983":240,"2984":53,"2985":153,"2986":250,"2987":239,"2988":108,"2989":9,"2990":74,"2991":105,"2992":46,"2993":201,"2994":57,"2995":96,"2996":104,"2997":74,"2998":174,"2999":154,"3000":255,"3001":118,"3002":0,"3003":49,"3004":151,"3005":16,"3006":23,"3007":241,"3008":172,"3009":72,"3010":177,"3011":129,"3012":86,"3013":166,"3014":111,"3015":190,"3016":98,"3017":51,"3018":128,"3019":248,"3020":204,"3021":109,"3022":120,"3023":153,"3024":9,"3025":99,"3026":200,"3027":221,"3028":6,"3029":202,"3030":126,"3031":196,"3032":68,"3033":145,"3034":61,"3035":105,"3036":129,"3037":206,"3038":157,"3039":248,"3040":242,"3041":75,"3042":205,"3043":116,"3044":52,"3045":201,"3046":251,"3047":229,"3048":68,"3049":188,"3050":44,"3051":235,"3052":189,"3053":220,"3054":110,"3055":42,"3056":90,"3057":34,"3058":143,"3059":113,"3060":139,"3061":171,"3062":121,"3063":164,"3064":0,"3065":120,"3066":134,"3067":173,"3068":205,"3069":177,"3070":87,"3071":191,"3072":210,"3073":222,"3074":182,"3075":222,"3076":198,"3077":90,"3078":62,"3079":159,"3080":232,"3081":96,"3082":221,"3083":209,"3084":92,"3085":94,"3086":143,"3087":80,"3088":124,"3089":115,"3090":175,"3091":85,"3092":164,"3093":99,"3094":32,"3095":71,"3096":242,"3097":165,"3098":165,"3099":132,"3100":14,"3101":92,"3102":141,"3103":74,"3104":110,"3105":39,"3106":227,"3107":92,"3108":170,"3109":217,"3110":196,"3111":158,"3112":57,"3113":53,"3114":156,"3115":17,"3116":66,"3117":14,"3118":205,"3119":159,"3120":40,"3121":131,"3122":173,"3123":224,"3124":52,"3125":84,"3126":191,"3127":149,"3128":130,"3129":37,"3130":90,"3131":191,"3132":109,"3133":104,"3134":174,"3135":110,"3136":198,"3137":222,"3138":221,"3139":36,"3140":177,"3141":108,"3142":229,"3143":99,"3144":226,"3145":166,"3146":172,"3147":27,"3148":63,"3149":121,"3150":158,"3151":8,"3152":248,"3153":73,"3154":170,"3155":18,"3156":245,"3157":58,"3158":170,"3159":55,"3160":179,"3161":194,"3162":247,"3163":40,"3164":103,"3165":251,"3166":169,"3167":126,"3168":179,"3169":66,"3170":224,"3171":179,"3172":132,"3173":115,"3174":116,"3175":193,"3176":198,"3177":236,"3178":241,"3179":88,"3180":192,"3181":88,"3182":189,"3183":91,"3184":206,"3185":179,"3186":232,"3187":120,"3188":134,"3189":170,"3190":117,"3191":193,"3192":124,"3193":197,"3194":95,"3195":119,"3196":247,"3197":237,"3198":139,"3199":11,"3200":66,"3201":149,"3202":126,"3203":85,"3204":54,"3205":74,"3206":47,"3207":61,"3208":139,"3209":135,"3210":64,"3211":227,"3212":176,"3213":178,"3214":81,"3215":114,"3216":26,"3217":111,"3218":50,"3219":103,"3220":140,"3221":241,"3222":151,"3223":163,"3224":110,"3225":14,"3226":183,"3227":200,"3228":245,"3229":207,"3230":40,"3231":38,"3232":131,"3233":116,"3234":207,"3235":237,"3236":135,"3237":182,"3238":178,"3239":151,"3240":128,"3241":245,"3242":1,"3243":230,"3244":43,"3245":89,"3246":224,"3247":125,"3248":123,"3249":56,"3250":231,"3251":117,"3252":125,"3253":81,"3254":111,"3255":69,"3256":203,"3257":155,"3258":33,"3259":69,"3260":139,"3261":51,"3262":176,"3263":140,"3264":74,"3265":19,"3266":66,"3267":239,"3268":49,"3269":126,"3270":158,"3271":75,"3272":135,"3273":218,"3274":155,"3275":204,"3276":27,"3277":50,"3278":236,"3279":232,"3280":123,"3281":199,"3282":211,"3283":223,"3284":106,"3285":147,"3286":24,"3287":139,"3288":84,"3289":135,"3290":85,"3291":84,"3292":129,"3293":11,"3294":193,"3295":156,"3296":202,"3297":43,"3298":142,"3299":159,"3300":92,"3301":100,"3302":253,"3303":48,"3304":116,"3305":120,"3306":134,"3307":173,"3308":193,"3309":156,"3310":148,"3311":99,"3312":141,"3313":39,"3314":98,"3315":27,"3316":5,"3317":180,"3318":129,"3319":89,"3320":153,"3321":30,"3322":35,"3323":113,"3324":87,"3325":223,"3326":32,"3327":186,"3328":190,"3329":65,"3330":213,"3331":118,"3332":108,"3333":45,"3334":69,"3335":212,"3336":251,"3337":107,"3338":159,"3339":98,"3340":91,"3341":90,"3342":31,"3343":6,"3344":111,"3345":247,"3346":23,"3347":176,"3348":212,"3349":39,"3350":39,"3351":191,"3352":209,"3353":6,"3354":225,"3355":227,"3356":192,"3357":196,"3358":202,"3359":19,"3360":187,"3361":47,"3362":195,"3363":22,"3364":115,"3365":215,"3366":42,"3367":239,"3368":85,"3369":238,"3370":21,"3371":93,"3372":57,"3373":2,"3374":142,"3375":134,"3376":78,"3377":229,"3378":228,"3379":140,"3380":41,"3381":220,"3382":224,"3383":173,"3384":17,"3385":75,"3386":109,"3387":163,"3388":124,"3389":221,"3390":111,"3391":187,"3392":87,"3393":246,"3394":20,"3395":127,"3396":141,"3397":159,"3398":141,"3399":102,"3400":172,"3401":31,"3402":227,"3403":247,"3404":244,"3405":166,"3406":8,"3407":168,"3408":24,"3409":104,"3410":118,"3411":249,"3412":247,"3413":142,"3414":99,"3415":102,"3416":248,"3417":81,"3418":66,"3419":87,"3420":253,"3421":198,"3422":148,"3423":146,"3424":0,"3425":11,"3426":104,"3427":174,"3428":64,"3429":57,"3430":120,"3431":134,"3432":173,"3433":126,"3434":94,"3435":225,"3436":124,"3437":155,"3438":122,"3439":70,"3440":137,"3441":84,"3442":210,"3443":159,"3444":195,"3445":197,"3446":87,"3447":125,"3448":38,"3449":211,"3450":88,"3451":94,"3452":108,"3453":160,"3454":170,"3455":3,"3456":185,"3457":52,"3458":96,"3459":129,"3460":189,"3461":44,"3462":146,"3463":33,"3464":116,"3465":47,"3466":134,"3467":130,"3468":215,"3469":52,"3470":28,"3471":81,"3472":230,"3473":90,"3474":44,"3475":29,"3476":131,"3477":97,"3478":242,"3479":209,"3480":43,"3481":199,"3482":147,"3483":153,"3484":20,"3485":230,"3486":175,"3487":138,"3488":62,"3489":92,"3490":133,"3491":111,"3492":182,"3493":236,"3494":27,"3495":55,"3496":115,"3497":31,"3498":106,"3499":10,"3500":1,"3501":250,"3502":246,"3503":241,"3504":139,"3505":157,"3506":37,"3507":12,"3508":71,"3509":254,"3510":89,"3511":227,"3512":241,"3513":150,"3514":63,"3515":245,"3516":66,"3517":121,"3518":192,"3519":111,"3520":32,"3521":84,"3522":254,"3523":184,"3524":201,"3525":195,"3526":126,"3527":82,"3528":57,"3529":246,"3530":118,"3531":207,"3532":142,"3533":101,"3534":16,"3535":13,"3536":139,"3537":144,"3538":233,"3539":215,"3540":82,"3541":230,"3542":253,"3543":2,"3544":3,"3545":178,"3546":120,"3547":134,"3548":169,"3549":31,"3550":146,"3551":190,"3552":54,"3553":96,"3554":62,"3555":127,"3556":118,"3557":51,"3558":138,"3559":250,"3560":143,"3561":38,"3562":56,"3563":29,"3564":78,"3565":26,"3566":70,"3567":163,"3568":219,"3569":234,"3570":192,"3571":189,"3572":43,"3573":144,"3574":89,"3575":99,"3576":254,"3577":146,"3578":34,"3579":106,"3580":4,"3581":205,"3582":86,"3583":96,"3584":32,"3585":23,"3586":48,"3587":189,"3588":93,"3589":168,"3590":206,"3591":66,"3592":89,"3593":158,"3594":23,"3595":153,"3596":192,"3597":255,"3598":175,"3599":208,"3600":142,"3601":177,"3602":44,"3603":16,"3604":187,"3605":141,"3606":46,"3607":232,"3608":35,"3609":131,"3610":150,"3611":112,"3612":59,"3613":189,"3614":60,"3615":216,"3616":98,"3617":254,"3618":44,"3619":22,"3620":39,"3621":80,"3622":193,"3623":252,"3624":103,"3625":71,"3626":53,"3627":97,"3628":149,"3629":65,"3630":205,"3631":244,"3632":155,"3633":84,"3634":236,"3635":75,"3636":154,"3637":30,"3638":63,"3639":19,"3640":21,"3641":244,"3642":23,"3643":169,"3644":51,"3645":107,"3646":52,"3647":148,"3648":165,"3649":136,"3650":160,"3651":75,"3652":124,"3653":214,"3654":12,"3655":54,"3656":167,"3657":120,"3658":134,"3659":121,"3660":101,"3661":147,"3662":81,"3663":41,"3664":138,"3665":117,"3666":186,"3667":170,"3668":238,"3669":42,"3670":1,"3671":150,"3672":247,"3673":14,"3674":167,"3675":170,"3676":116,"3677":209,"3678":220,"3679":218,"3680":112,"3681":77,"3682":29,"3683":173,"3684":19,"3685":56,"3686":77,"3687":117,"3688":1,"3689":13,"3690":29,"3691":172,"3692":17,"3693":91,"3694":250,"3695":181,"3696":189,"3697":153,"3698":29,"3699":114,"3700":110,"3701":235,"3702":158,"3703":122,"3704":143,"3705":124,"3706":20,"3707":121,"3708":8,"3709":59,"3710":30,"3711":60,"3712":99,"3713":83,"3714":95,"3715":114,"3716":231,"3717":92,"3718":232,"3719":117,"3720":123,"3721":54,"3722":209,"3723":44,"3724":29,"3725":99,"3726":87,"3727":113,"3728":92,"3729":90,"3730":226,"3731":84,"3732":16,"3733":140,"3734":127,"3735":87,"3736":144,"3737":203,"3738":4,"3739":43,"3740":237,"3741":153,"3742":186,"3743":113,"3744":250,"3745":141,"3746":47,"3747":191,"3748":180,"3749":7,"3750":70,"3751":195,"3752":161,"3753":99,"3754":12,"3755":222,"3756":249,"3757":93,"3758":216,"3759":250,"3760":120,"3761":134,"3762":50,"3763":131,"3764":141,"3765":181,"3766":171,"3767":171,"3768":213,"3769":172,"3770":51,"3771":65,"3772":164,"3773":129,"3774":87,"3775":159,"3776":106,"3777":111,"3778":6,"3779":167,"3780":26,"3781":244,"3782":7,"3783":168,"3784":230,"3785":100,"3786":163,"3787":232,"3788":23,"3789":170,"3790":23,"3791":67,"3792":105,"3793":218,"3794":205,"3795":130,"3796":191,"3797":155,"3798":79,"3799":248,"3800":227,"3801":212,"3802":146,"3803":219,"3804":128,"3805":21,"3806":78,"3807":199,"3808":199,"3809":56,"3810":41,"3811":53,"3812":47,"3813":126,"3814":186,"3815":7,"3816":122,"3817":186,"3818":250,"3819":227,"3820":15,"3821":0,"3822":112,"3823":131,"3824":248,"3825":75,"3826":134,"3827":233,"3828":247,"3829":37,"3830":227,"3831":155,"3832":28,"3833":213,"3834":132,"3835":44,"3836":212,"3837":76,"3838":173,"3839":138,"3840":65,"3841":103,"3842":50,"3843":232,"3844":237,"3845":89,"3846":97,"3847":147,"3848":11,"3849":21,"3850":87,"3851":225,"3852":67,"3853":8,"3854":50,"3855":156,"3856":119,"3857":212,"3858":115,"3859":120,"3860":13,"3861":39,"3862":227,"3863":114,"3864":37,"3865":101,"3866":133,"3867":141,"3868":188,"3869":145,"3870":54,"3871":130,"3872":226,"3873":239,"3874":151,"3875":67,"3876":193,"3877":179,"3878":221,"3879":71,"3880":241,"3881":90,"3882":159,"3883":177,"3884":89,"3885":249,"3886":22,"3887":213,"3888":99,"3889":58,"3890":17,"3891":130,"3892":12,"3893":142,"3894":24,"3895":149,"3896":132,"3897":57,"3898":163,"3899":0,"3900":8,"3901":237,"3902":230,"3903":23,"3904":169,"3905":60,"3906":67,"3907":197,"3908":147,"3909":4,"3910":44,"3911":175,"3912":193,"3913":146,"3914":109,"3915":15,"3916":94,"3917":205,"3918":171,"3919":173,"3920":187,"3921":127,"3922":228,"3923":177,"3924":217,"3925":255,"3926":20,"3927":197,"3928":165,"3929":88,"3930":40,"3931":136,"3932":17,"3933":176,"3934":212,"3935":23,"3936":155,"3937":110,"3938":59,"3939":92,"3940":191,"3941":83,"3942":248,"3943":39,"3944":188,"3945":240,"3946":242,"3947":96,"3948":246,"3949":110,"3950":224,"3951":35,"3952":0,"3953":127,"3954":6,"3955":70,"3956":106,"3957":39,"3958":105,"3959":120,"3960":20,"3961":163,"3962":103,"3963":36,"3964":120,"3965":13,"3966":37,"3967":201,"3968":176,"3969":82,"3970":68,"3971":57,"3972":144,"3973":183,"3974":63,"3975":15,"3976":59,"3977":246,"3978":84,"3979":77,"3980":134,"3981":200,"3982":216,"3983":249,"3984":94,"3985":93,"3986":247,"3987":105,"3988":179,"3989":38,"3990":164,"3991":119,"3992":116,"3993":215,"3994":36,"3995":251,"3996":190,"3997":38,"3998":76,"3999":139,"4000":48,"4001":65,"4002":52,"4003":21,"4004":160,"4005":251,"4006":133,"4007":211,"4008":151,"4009":200,"4010":153,"4011":248,"4012":84,"4013":174,"4014":56,"4015":112,"4016":103,"4017":180,"4018":53,"4019":206,"4020":188,"4021":158,"4022":155,"4023":229,"4024":196,"4025":214,"4026":219,"4027":69,"4028":116,"4029":96,"4030":22,"4031":91,"4032":64,"4033":205,"4034":55,"4035":254,"4036":135,"4037":215,"4038":251,"4039":163,"4040":119,"4041":183,"4042":24,"4043":128,"4044":86,"4045":104,"4046":155,"4047":163,"4048":90,"4049":118,"4050":141,"4051":203,"4052":246,"4053":231,"4054":178,"4055":112,"4056":108,"4057":130,"4058":31,"4059":27,"4060":92,"4061":200,"4062":113,"4063":120,"4064":13,"4065":37,"4066":218,"4067":135,"4068":157,"4069":141,"4070":138,"4071":173,"4072":50,"4073":34,"4074":213,"4075":187,"4076":54,"4077":33,"4078":4,"4079":112,"4080":120,"4081":20,"4082":143,"4083":244,"4084":241,"4085":114,"4086":247,"4087":14,"4088":108,"4089":50,"4090":142,"4091":162,"4092":52,"4093":124,"4094":246,"4095":42,"4096":145,"4097":177,"4098":7,"4099":75,"4100":48,"4101":34,"4102":140,"4103":253,"4104":94,"4105":15,"4106":229,"4107":13,"4108":3,"4109":85,"4110":99,"4111":220,"4112":214,"4113":0,"4114":227,"4115":218,"4116":150,"4117":199,"4118":178,"4119":65,"4120":53,"4121":77,"4122":159,"4123":188,"4124":22,"4125":130,"4126":183,"4127":96,"4128":87,"4129":13,"4130":49,"4131":157,"4132":157,"4133":189,"4134":235,"4135":205,"4136":178,"4137":184,"4138":41,"4139":97,"4140":146,"4141":206,"4142":92,"4143":125,"4144":239,"4145":138,"4146":145,"4147":115,"4148":150,"4149":161,"4150":3,"4151":0,"4152":36,"4153":24,"4154":192,"4155":6,"4156":120,"4157":139,"4158":241,"4159":146,"4160":198,"4161":45,"4162":147,"4163":157,"4164":120,"4165":14,"4166":232,"4167":141,"4168":206,"4169":225,"4170":50,"4171":25,"4172":111,"4173":77,"4174":5,"4175":53,"4176":141,"4177":153,"4178":139,"4179":217,"4180":56,"4181":51,"4182":63,"4183":26,"4184":56,"4185":169,"4186":112,"4187":251,"4188":16,"4189":105,"4190":77,"4191":253,"4192":129,"4193":166,"4194":9,"4195":195,"4196":166,"4197":131,"4198":195,"4199":225,"4200":236,"4201":102,"4202":173,"4203":243,"4204":76,"4205":202,"4206":142,"4207":166,"4208":227,"4209":252,"4210":95,"4211":8,"4212":157,"4213":110,"4214":207,"4215":151,"4216":120,"4217":227,"4218":90,"4219":120,"4220":213,"4221":196,"4222":221,"4223":209,"4224":8,"4225":200,"4226":54,"4227":50,"4228":42,"4229":38,"4230":40,"4231":214,"4232":240,"4233":2,"4234":164,"4235":175,"4236":119,"4237":139,"4238":46,"4239":4,"4240":32,"4241":54,"4242":160,"4243":155,"4244":95,"4245":11,"4246":193,"4247":113,"4248":47,"4249":229,"4250":43,"4251":171,"4252":31,"4253":7,"4254":98,"4255":90,"4256":163,"4257":242,"4258":70,"4259":135,"4260":13,"4261":99,"4262":100,"4263":154,"4264":193,"4265":229,"4266":228,"4267":120,"4268":14,"4269":237,"4270":128,"4271":142,"4272":157,"4273":169,"4274":123,"4275":64,"4276":113,"4277":107,"4278":245,"4279":20,"4280":218,"4281":43,"4282":33,"4283":114,"4284":41,"4285":81,"4286":243,"4287":226,"4288":222,"4289":0,"4290":10,"4291":246,"4292":214,"4293":24,"4294":102,"4295":180,"4296":181,"4297":187,"4298":80,"4299":58,"4300":107,"4301":19,"4302":247,"4303":205,"4304":123,"4305":201,"4306":222,"4307":72,"4308":162,"4309":80,"4310":225,"4311":218,"4312":133,"4313":193,"4314":29,"4315":16,"4316":205,"4317":190,"4318":224,"4319":195,"4320":205,"4321":238,"4322":255,"4323":224,"4324":96,"4325":68,"4326":59,"4327":234,"4328":80,"4329":70,"4330":64,"4331":48,"4332":5,"4333":22,"4334":234,"4335":138,"4336":1,"4337":73,"4338":118,"4339":60,"4340":153,"4341":19,"4342":191,"4343":4,"4344":16,"4345":170,"4346":173,"4347":62,"4348":172,"4349":82,"4350":214,"4351":46,"4352":5,"4353":143,"4354":96,"4355":213,"4356":164,"4357":0,"4358":38,"4359":187,"4360":212,"4361":164,"4362":117,"4363":120,"4364":13,"4365":29,"4366":221,"4367":204,"4368":117,"4369":209,"4370":70,"4371":217,"4372":140,"4373":186,"4374":33,"4375":169,"4376":72,"4377":15,"4378":254,"4379":45,"4380":226,"4381":101,"4382":101,"4383":163,"4384":175,"4385":223,"4386":120,"4387":226,"4388":243,"4389":195,"4390":228,"4391":117,"4392":241,"4393":151,"4394":199,"4395":187,"4396":179,"4397":30,"4398":233,"4399":159,"4400":162,"4401":8,"4402":184,"4403":46,"4404":123,"4405":137,"4406":97,"4407":95,"4408":173,"4409":150,"4410":34,"4411":68,"4412":181,"4413":209,"4414":15,"4415":189,"4416":220,"4417":208,"4418":170,"4419":105,"4420":171,"4421":134,"4422":92,"4423":74,"4424":235,"4425":250,"4426":136,"4427":44,"4428":181,"4429":121,"4430":31,"4431":136,"4432":180,"4433":255,"4434":30,"4435":66,"4436":27,"4437":162,"4438":211,"4439":90,"4440":139,"4441":171,"4442":23,"4443":94,"4444":10,"4445":64,"4446":142,"4447":28,"4448":17,"4449":239,"4450":140,"4451":28,"4452":214,"4453":216,"4454":109,"4455":78,"4456":211,"4457":120,"4458":12,"4459":65,"4460":67,"4461":40,"4462":187,"4463":24,"4464":110,"4465":92,"4466":14,"4467":173,"4468":107,"4469":157,"4470":196,"4471":5,"4472":58,"4473":174,"4474":55,"4475":159,"4476":228,"4477":198,"4478":66,"4479":38,"4480":224,"4481":63,"4482":110,"4483":72,"4484":96,"4485":88,"4486":39,"4487":254,"4488":60,"4489":22,"4490":214,"4491":105,"4492":196,"4493":42,"4494":102,"4495":251,"4496":168,"4497":133,"4498":242,"4499":176,"4500":210,"4501":144,"4502":127,"4503":53,"4504":51,"4505":234,"4506":74,"4507":159,"4508":196,"4509":18,"4510":30,"4511":85,"4512":71,"4513":192,"4514":242,"4515":253,"4516":130,"4517":84,"4518":52,"4519":246,"4520":138,"4521":108,"4522":168,"4523":142,"4524":12,"4525":82,"4526":175,"4527":2,"4528":251,"4529":212,"4530":176,"4531":113,"4532":250,"4533":126,"4534":152,"4535":203,"4536":188,"4537":166,"4538":141,"4539":247,"4540":80,"4541":179,"4542":189,"4543":77,"4544":158,"4545":164,"4546":230,"4547":243,"4548":120,"4549":12,"4550":78,"4551":59,"4552":84,"4553":41,"4554":14,"4555":90,"4556":135,"4557":167,"4558":72,"4559":158,"4560":51,"4561":76,"4562":3,"4563":184,"4564":248,"4565":33,"4566":24,"4567":50,"4568":122,"4569":247,"4570":64,"4571":17,"4572":167,"4573":80,"4574":121,"4575":121,"4576":126,"4577":13,"4578":128,"4579":120,"4580":110,"4581":192,"4582":22,"4583":63,"4584":149,"4585":145,"4586":79,"4587":195,"4588":135,"4589":30,"4590":39,"4591":242,"4592":216,"4593":128,"4594":148,"4595":230,"4596":239,"4597":195,"4598":84,"4599":72,"4600":94,"4601":59,"4602":120,"4603":166,"4604":139,"4605":208,"4606":254,"4607":167,"4608":237,"4609":57,"4610":149,"4611":216,"4612":129,"4613":206,"4614":43,"4615":179,"4616":204,"4617":202,"4618":90,"4619":132,"4620":226,"4621":186,"4622":124,"4623":251,"4624":12,"4625":149,"4626":58,"4627":198,"4628":59,"4629":25,"4630":117,"4631":78,"4632":211,"4633":252,"4634":70,"4635":185,"4636":183,"4637":135,"4638":95,"4639":231,"4640":228,"4641":218,"4642":27,"4643":104,"4644":57,"4645":179,"4646":120,"4647":12,"4648":89,"4649":81,"4650":199,"4651":54,"4652":97,"4653":170,"4654":35,"4655":169,"4656":197,"4657":145,"4658":51,"4659":75,"4660":50,"4661":222,"4662":99,"4663":184,"4664":46,"4665":109,"4666":141,"4667":84,"4668":23,"4669":67,"4670":165,"4671":59,"4672":144,"4673":51,"4674":248,"4675":222,"4676":85,"4677":83,"4678":96,"4679":78,"4680":253,"4681":138,"4682":100,"4683":108,"4684":29,"4685":233,"4686":129,"4687":145,"4688":174,"4689":104,"4690":30,"4691":150,"4692":150,"4693":136,"4694":24,"4695":134,"4696":179,"4697":20,"4698":237,"4699":93,"4700":207,"4701":75,"4702":55,"4703":97,"4704":224,"4705":91,"4706":237,"4707":112,"4708":179,"4709":228,"4710":48,"4711":219,"4712":163,"4713":60,"4714":195,"4715":245,"4716":25,"4717":250,"4718":152,"4719":71,"4720":43,"4721":192,"4722":192,"4723":29,"4724":79,"4725":52,"4726":78,"4727":208,"4728":178,"4729":255,"4730":245,"4731":9,"4732":185,"4733":11,"4734":239,"4735":184,"4736":43,"4737":105,"4738":251,"4739":189,"4740":129,"4741":213,"4742":119,"4743":115,"4744":64,"4745":191,"4746":188,"4747":118}

decoder.on('decode') callback is not firing.

Maybe you can suggest what I'm doing wrong?

extract raw opus stream from existing ogg file

First of all, thanks for your excellent work :>
The server.js example works as expected and the sound can be played in the chrome browser.

I tried out my own ogg/opus file and split it into chunks using NNNN.txt format but they cannot be played normally. I guess it may be due to the fact that server.js expects to receive raw OPUS data without ogg header.

My question is... how can I extract the raw OPUS stream from an ogg file? I tried out ffmpeg and opusenc with no luck since they all convert audio in opus with ogg header.

Would you please advise the tool to extract raw stream? Any suggestion?

I think it doesn't work

I actually dont know if I'm doing it wrong or there are any glitches. But the reproduction is like this:

  • get audio from browser with navigator.mediaDevices.getUserMedia
  • capture packets with mediaRecorder.request data
  • get arrayBuffer from event.Blob and send it to OpusToPCM.decode
  • I set decoder.on('data'), but it is not called

I followed the docs, but it is not working.

Only noise..

I'm trying to stream a pulseaudio pcm to web browser, but i only get noise.
Any help?
Thanks in advance

Here is the code:
nodejs

var path = require('path');
const WebSocket = require('ws');
const Pulse = require('pulseaudio2');
const prism = require('prism-media');

async function main() {
  const ctx = new Pulse();
  const rate = 24000
  ctx.on('state', (state) => {
      console.log('context:', state);
  });
  ctx.on('error', function(error){
    console.log(error)
    //
  });

  const opts = {
    channels: 1,
    rate:rate,
    format:'s16le',
    flags:'adjust_latency',
    latency:1000,
    properties: {
        'filter.want': 'echo-cancel',
        'application.id': 'node-stream-echo-cancelled',
    }
  };

  var rec = ctx.createRecordStream(opts)
  rec.on('state', (state) => {
    console.log('record:', state);
  });

  const express = require('express')
  const app = express()
  const server = require('http').createServer(app)
  app.use(express.static(path.resolve(__dirname, "./receiver")));
  server.listen(8080, function(){
    console.log('listening on port 8080')
  })
  var wss = new WebSocket.Server({server: server });
  wss.binaryType = "arraybuffer";
  console.log('Server ready...');
  wss.on('connection', function connection(ws) {
          console.log('Socket connected. sending data...');
  });

  const opus = new prism.opus.Encoder({ rate: rate, channels: 1, frameSize: rate/100});
  rec.pipe(opus)  
  opus.on("data", (buff) =>{
    wss.clients.forEach(function each(client) {
      if (client.readyState === WebSocket.OPEN) {
          client.send(buff);
      }
    });
  }) 

}

main();

html client

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Opus to PCM</title>
    <script type="text/javascript" src="./pcm-player.min.js"></script>
    <script type="text/javascript" src="./dist/opus_to_pcm.js"></script>
</head>
<body>
<div id="container" style="width: 400px; margin: 0 auto;">
    <h2>It should play audio if everying went well!</h2>
</div>
<script>
 window.onload = function() {
   var socketURL = 'ws://localhost:8080';
    var channels = 1;
   var decoder = new OpusToPCM({
        channels: channels,
        fallback: true,
        libopusPath: './dist/libopus/opus.min.js' 
    });
    var srate = decoder.getSampleRate()
    /*
    var player = new PCMPlayer({
        encoding: '16bitInt',
        channels: channels,
        sampleRate: decoder.getSampleRate(),
        flushingTime: 500
   });
   */
   var player = new PCMPlayer(channels, decoder.getSampleRate());   
    decoder.on('decode', function(pcmData) {
        player.feed(pcmData);    
    });

    var ws = new WebSocket(socketURL);
       ws.binaryType = 'arraybuffer';
       ws.addEventListener('message',function(event) {
                var data = new Uint8Array(event.data);
                decoder.decode(data)
    });

 }   
  
</script>
</body>
</html>

** Updated to 1 channel everywhere

How to convert a raw Opus file I have locally?

I've a raw Opus file that I want to convert to 16-bit PCM. I see you commented on #19 that it's not possible using this library. However, it's not clear to me how to actually do the first step, which is make a playable Opus file from the raw data using this library. The examples/index.html doesn't have any upload file option, which I thought what an example should be all about.

I do see mention of Node stuff, but not being a JS/front end dev, it's not clear to me what to do with that. Can you provide clear usage instructions?

Delay of arround 1 sec while playing decoded audio.

Hello I have used this opus decoding code and integrated in my application to play encoded opus audio. Audio is decoding properly and I am getting clear audio.
But the problem is it is playing audio 1 sec late as compared to video.
I have audio and video data coming on web sockets in java-script and I am decoding both but audio lagging behind video exactly 1 sec.
I have also tried only playing audio with decoding and playing in java-script and compared with VLC audio of same stream ans I have noticed around 1 sec delay.
Any help would be appreciated.

Thanks,
Kuldeep.

write file

Hi

Have opus encoded packets in zello-channel-api, but how to write data to .opus file?

Thx

Configurations used to create raw opus packet

What is the configuration used (like number of channels, bitrate, sample rate) for the raw opus packet provided in the example folder?

We have a stream of 16-bit PCM data, which we have converted to raw opus packet using lipopus and tried to convert it to PCM using this library.

We have also tried decodeAudioData on the Ogg pages created from 16-bit PCM data using lipopusenc.

Configuration used for our sample is

  • Number of channels - 1
  • Sample rate - 48000
  • Bit Rate - 64000

In both the above cases, we are getting the following error on decodeAudioData.

DOMException: Failed to execute 'decodeAudioData' on 'BaseAudioContext': Unable to decode audio data

Any help would be appreciated. @samirkumardas

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.