We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/** * * @param {import('./resample').TypedArray} src * @param {Float32Array?} dest * @param component_type */ function normalize(src, dest, component_type) { let elementSize = 4, len = src.length; do { if (len % elementSize === 0) { break; } elementSize--; } while (elementSize > 1); if (!dest || !(dest instanceof Float32Array) || dest.length < len) { dest = new Float32Array(len); } const chunkCount = (memory.length / elementSize) | 0; const chunkSize = elementSize * chunkCount; const ptr = wasmPtr(0); let offset = 0; while (offset < len) { let currChunkSize = chunkSize; let currChunkCount = chunkCount; if (offset + currChunkSize > len) { currChunkSize = len - offset; currChunkCount = currChunkSize / elementSize; } memory.set(src.subarray(offset, offset + currChunkSize), 0); instance.exports.normalize( ptr, elementSize, elementSize, currChunkCount, component_type ); dest.set(memory.subarray(0, currChunkCount), offset); offset += currChunkSize; } return dest; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: