Hi!
For now, node’s Buffers are interpreted by ndarrays as having simple UInt8 type, where each value is integer within 0..255 range, and is accessed as buffer[index]. There seems to be a lot of applications of buffers with other types, like float, or int32. For example, node-speaker takes int16LE buffers, which is default for PCM-streams encoding, AFAIK, and other libs work with float-typed buffers.
It would be super-awesome ndarrays take all the routine work of handling buffer types, as far there are lots of them.
Or what is the most appropriate solution for that? Current status quo is a bit frustrating.
As a workaround now, it is possible to create "generic" wrapper for buffers, but is seems like duplicating of ndarray’s work.
Hi!
For now, node’s Buffers are interpreted by ndarrays as having simple
UInt8type, where each value is integer within0..255range, and is accessed asbuffer[index]. There seems to be a lot of applications of buffers with other types, likefloat, orint32. For example, node-speaker takesint16LEbuffers, which is default for PCM-streams encoding, AFAIK, and other libs work withfloat-typed buffers.It would be super-awesome ndarrays take all the routine work of handling buffer types, as far there are lots of them.
Or what is the most appropriate solution for that? Current status quo is a bit frustrating.
As a workaround now, it is possible to create "generic" wrapper for buffers, but is seems like duplicating of ndarray’s work.