typed-arrays Questions
4
Solved
I have the following snippet:
new Uint16Array( arraybuffer, 0, 18108 );
I know that arraybuffer is an instance of ArrayBuffer, and that arraybuffer.byteLength is 31984. The content of the arrayb...
Skellum asked 8/3, 2017 at 5:54
3
Solved
I have some audio buffer in usigned 8bit PCM format need to play via web audio which only accept signed 32bit PCM. And now I have ArrayBuffer for pieces of pcm_u8 data(come from Uint8array). How ca...
Dierdredieresis asked 8/1, 2016 at 4:30
2
I have a nodejs script where I'd like to parse MP3 frames. Those frames are easy to detect since each frame starts with the two bytes 0xff 0xfb.
I'm using a Uint8Array to access the bytes of that ...
Crustacean asked 3/1, 2013 at 21:4
3
Solved
I am working on a web app that opens binary files and allows them to be edited.
This process is basically ondrop -> dataTransfer.files[0] -> FileReader -> Uint8Array
Essentially, I want ...
Blowzed asked 17/8, 2014 at 22:39
7
Solved
Is there a way how to test if two JavaScript ArrayBuffers are equal? I would like to write test for message composing method. The only way I found is to convert the ArrayBuffer to string and then c...
Janniejanos asked 4/2, 2014 at 13:12
7
I have an array of several Uint8Arrays.
Something similar to this:
[Uint8Array(16384), Uint8Array(16384), Uint8Array(16384), Uint8Array(16384), Uint8Array(16384), Uint8Array(8868)]
How do I merge...
Callihan asked 6/3, 2018 at 11:21
29
Solved
Is there a commonly accepted technique for efficiently converting JavaScript strings to ArrayBuffers and vice-versa? Specifically, I'd like to be able to write the contents of an ArrayBuffer to loc...
Renfrew asked 6/8, 2011 at 6:1
3
Solved
I have a typed array full of binary data that is being generated from an ArrayBuffer
var myArr = new Uint8Array(myBuffer);
I am presenting this to the user with
var blob = new Blob(myArr, {typ...
Trough asked 2/5, 2016 at 14:52
2
Solved
I have this content script that downloads some binary data using XHR, which is sent later to the background script:
var self = this;
var xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.respo...
Theatricals asked 21/12, 2011 at 17:32
2
Solved
I'd like to convert an AudioBuffer to a Blob so that I can create an ObjectURL from it and then download the audio file.
let rec = new Recorder(async(chunks) => {
var blob = new Blob(chunks, {...
Tishatishri asked 3/6, 2020 at 12:2
7
Solved
I'm using WebGL to render a binary encoded mesh file. The binary file is written out in big-endian format (I can verify this by opening the file in a hex editor, or viewing the network traffic usin...
Neille asked 23/10, 2011 at 22:37
2
Solved
I'm implementing my own <declare-styleable> for a custom View (following the instructions here). I'd like to be able to specify an array of integers as one of the possible XML attributes. How...
Etty asked 8/1, 2013 at 16:33
4
Solved
What is the preferable way of appending/combining ArrayBuffers?
I'm receiving and parsing network packets with a variety of data structures. Incoming messages are read into ArrayBuffers. If a part...
Weinman asked 28/5, 2012 at 14:16
8
Solved
I'd like to merge multiple arraybuffers to create a Blob. however, as you know,
TypedArray dosen't have "push" or useful methods...
E.g.:
var a = new Int8Array( [ 1, 2, 3 ] );
var b = new Int8Ar...
Boehmer asked 28/12, 2012 at 15:2
1
This Question is related to and inspired by How to updoad in old browsers (ex Safari 5.1.4)
Given an <input type="file"> element having a files property containing File objects whic...
Hymenopteran asked 5/7, 2016 at 5:37
1
Solved
I have a Vec I would like to return and convert to a typed array with wasm-bindgen, ie, to turn a Vec<u32> into a Uint32Array. From my research it appears that wasm-bindgen cannot handle auto...
Ita asked 20/10, 2020 at 23:19
3
Solved
I'd like to read a binary file with a few 32 bit float values at byte offset 31.
Unfortunately, new Float32Array(buffer, 31, 6); does not work. An offset of 32 instead of 31 works but I need 31.
...
Chopin asked 10/9, 2011 at 13:45
6
I'm looking to convert a Float32Array into an Int16Array.
Here's what I have (i'm not providing data).
var data = ...; /*new Float32Array();*/
var dataAsInt16Array = new Int16Array(data.length)...
Neonate asked 15/9, 2014 at 0:4
1
Solved
I've got a simple c function.
void fill(float *a, float *b)
{
a[0] = 1;
b[0] = 2;
}
int main()
{
float a[1];
float b[1];
fill(a, b);
printf("%f\n", a[0]);
printf("%f\n", b[0]);
return ...
Alcus asked 16/7, 2019 at 11:54
2
Solved
I work with typed arrays a lot and a lot of my functions really should be able to work with any sort of typed array (e.g., summing a Uint8Array or a Float32Array). Sometimes, I can get away with ju...
Endstopped asked 4/7, 2019 at 8:50
3
Solved
JavaScript typed arrays, implemented in Firefox 4 and Chrome 7, are a very efficient way of storing and working with binary data in JavaScript. However, the current implementations only provide int...
U asked 18/5, 2011 at 7:12
2
So there is are a lot of examples on how to write an entire pixel from a Uint32Array view of the ImageData object. But is it possible to read an entire pixel without incrementing the counter 4 time...
Incised asked 21/5, 2013 at 20:43
2
Solved
I want to convert buffer data to byte array. Here's what I've tried
import * as fs from 'fs';
[...]
event:(data) => {
fs.readFile(data, function(err, data) {
var arrByte= new Uint8Array(data)...
Psychedelic asked 25/7, 2018 at 5:22
1
Solved
Take the following snippet:
const arr = [1.1, 2.2, 3.3]
const arrBuffer = (Float32Array.from(arr)).buffer
How would one cast this ArrayBuffer to a SharedArrayBuffer?
const sharedArrBuffer = ......
Ponceau asked 9/1, 2019 at 14:29
1
Solved
I've 16 bytes data I'm storing in Uint8Array. I need to store this data in the browser and must get it in some other class.
so my code looks like this:
const ivBytes = window.crypto.getRandomValu...
String asked 20/9, 2018 at 7:21
1 Next >
© 2022 - 2025 — McMap. All rights reserved.