ArrayBuffer is a Javascript data type used to represent a generic, fixed-length binary data buffer.
Questions tagged [arraybuffer]
597 questions
5
votes
2 answers
How to get mime type of an array buffer object?
I am working on an API which is fetching file data as arraybuffer type. What my main question is there any of knowing what is the mime type of the file from the arraybuffer as I need to convert it to BLOB to view the file.
var file1 = new…

Avishek
- 524
- 16
- 38
5
votes
3 answers
Google Text-toSpeech - Getting the Audio File in Front-end
I have a requirement where I need to convert some text to audio using Google Text to Speech.
I am using Nodejs to get convert the text to audio file, and want to send the audio output to the front-end.
NodeJS code:
const client = new…

asanas
- 3,782
- 11
- 43
- 72
5
votes
0 answers
Javascript ArrayBuffer modification performance
I want to modify an ArrayBuffer's contents in JavaScript.
From the help section:
You cannot directly manipulate the contents of an ArrayBuffer;
instead, you create one of the typed array objects or a DataView
object which represents the buffer…

Daniel
- 2,318
- 2
- 22
- 53
5
votes
1 answer
Read file from relative path as ArrayBuffer
I'm trying to read a local file into an ArrayBuffer using the FileReader API, like this
let reader = new FileReader();
reader.onload = function(e) {
let arrayBuffer = new Uint8Array(reader.result);
…

aaugustho
- 53
- 1
- 1
- 5
5
votes
2 answers
writeBuffer of ExcelJS doesn't return Buffer type
I'm using exceljs with Typescript in my project. But writeBuffer() function returns ExcelJS.Buffer instead of Buffer type. And since ExcelJS.Buffer inherits from ArrayBuffer, converting ArrayBuffer to Buffer will break excel file. Does anyone have a…

Tran B. V. Son
- 759
- 2
- 12
- 31
5
votes
3 answers
How to concat chunks of incoming binary into video (webm) file node js?
I am trying to upload chunks of base64 to node js server and save those chunks into one file
let chunks = [];
app.post('/api', (req, res) => {
let {blob} = req.body;
//converting chunks of base64 to buffer
chunks.push(Buffer.from(blob,…

Nane
- 2,370
- 6
- 34
- 74
5
votes
6 answers
scala ArrayBuffer remove all elements with a predicat
Scala is very elegant in filtering immutable sequences:
var l = List(1,2,3,4,5,6)
l = l.filter(_%2==1)
But how do I do this with a mutable collections like ArrayBuffer?
All I found is the removal of single elements or slices, or remove elements…

Arne
- 7,921
- 9
- 48
- 66
5
votes
2 answers
Cannot get the value of an ArrayBuffer Object in Javascript
I have an ArrayBuffer object that I need to be able to convert to String to JSON, but I can't get the value of the [Int8Array] out of the object, even though it is clearly there.
I've tried all variations on this, but they all return…

Sven0567
- 315
- 3
- 16
5
votes
0 answers
ArrayBuffer when stringified becomes empty object
In my app, i'm uploading a file using FileReader and parsing it as an ArrayBuffer. The file properties are saved in an object, with structure like this:
file: {
name: 'fileName', // type string
content: ArrayBuffer // read like …

idjuradj
- 1,355
- 6
- 19
- 31
5
votes
1 answer
How to produce a `ArrayBuffer` from `bytes` using `js_of_ocaml`
I am building a JavaScript library that is implemented in Ocaml and compiled to JavaScript using js_of_ocaml.
One of my Ocaml function returns a string with binary data. How can I expose that using js_of_ocaml as a ArrayBuffer?

Joachim Breitner
- 25,395
- 6
- 78
- 139
5
votes
1 answer
How to use ArrayBuffers with DataViews in JavaScript
The only real tutorial I have seen for ArrayBuffer is from HTML5Rocks. But I am wondering specifically how to manipulate the individual bytes. For example, this cartoon on ArrayBuffers from Mozilla shows an image of an ArrayBuffer wrapped in a…

Lance
- 75,200
- 93
- 289
- 503
5
votes
2 answers
How to play arraybuffer on video tag?
I'm getting images from html canvas and would like to convert these images into a video. Search long and hard. Just want to take a couple of images and make them into a video. I manage to pass multiple images to a library engine and it return me a…

webecon
- 69
- 1
- 7
5
votes
1 answer
Why are the messages sent over WebRTC received in a different order sometimes?
I use ordered set to true, however when many (1000 or more) messages are sent in a short period of time (< 1 second) the messages received are not all received in the same order.
rtcPeerConnection.createDataChannel("app", {
ordered: true,
…

Walle Cyril
- 3,087
- 4
- 23
- 55
5
votes
0 answers
SourceBuffer buffered not updating length
In the following code, console.log(sb.buffered) is giving me a TimeRanges object of length 0. Why is this? I checked what xhr.response is, and it is an ArrayBuffer of approximately 58000 byteLength.
var ms;
var sb;
var mimeCodec = 'video/mp4;…

Lucas Cheon
- 51
- 1
5
votes
1 answer
JavaScript- convert array buffer to string
Title says it all.
I have a jquery serialized data that looks like this:
tarid=value&tarname=value&sel=3
And I want to convert it to ArrayBuffer.
After that, I also need to turn it back to its original form again.
So how can I do that?

Kadir Damene
- 358
- 1
- 3
- 10