MCPcopy Create free account
hub / github.com/Wscats/chrome-devtools-cli / parseRIFF

Function parseRIFF

src/__tests__/MediaStreamRecorder.js:2565–2583  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

2563 }
2564
2565 function parseRIFF(string) {
2566 var offset = 0;
2567 var chunks = {};
2568
2569 while (offset < string.length) {
2570 var id = string.substr(offset, 4);
2571 var len = getStrLength(string, offset);
2572 var data = string.substr(offset + 4 + 4, len);
2573 offset += 4 + 4 + len;
2574 chunks[id] = chunks[id] || [];
2575
2576 if (id === 'RIFF' || id === 'LIST') {
2577 chunks[id].push(parseRIFF(data));
2578 } else {
2579 chunks[id].push(data);
2580 }
2581 }
2582 return chunks;
2583 }
2584
2585 function doubleToString(num) {
2586 return [].slice.call(

Callers 1

whammyInWebWorkerFunction · 0.85

Calls 1

getStrLengthFunction · 0.85

Tested by

no test coverage detected