Closed cnm-n closed 5 years ago
Oh, that's unfortunate.
The underlying type is an ogg-packet: https://github.com/TooTallNate/node-ogg-packet/blob/master/index.js
You'll get the actual Opus data with data.packet
. Note that there are some metadata frames in there as well, you can skip these by checking for data.granulepos
- the headers and tags do not have a position and will define the granulepos
as -1.
@Rantanen: the data.packet
is only first byte of the packet
(uchar
). Is there a way to get all data without reading memory manually?
Probably not. I don't know the insides of the node-ogg or ref-struct packages that well. Personally I've used the raw encode/decode calls instead of the stream interface. You might have more luck with that.
I'm trying to encode some PCM data:
The output object contains two fields:
'ref.buffer'
andflush
, whereref.buffer
is:where
_refs
buffer seems like valid opus data. I expected to get raw node buffer.Node v11.10.0