libvorbis audio decode from memory in C++

后端 未结 2 854
失恋的感觉
失恋的感觉 2021-02-20 08:42

Given an encoded buffer in C++, what would be the steps using oggvorbis structs to decode the already in-memory data?

OggVorbis_File cannot be used, because assets are w

2条回答
  •  广开言路
    2021-02-20 09:19

    You also can don't reinvent the wheel and use fmemopen like this:

    FILE* memfile = fmemopen(data, len, "r");
    

    Where data is pointer to memory beginning and len is length of your data. Then pass memfile to ov_open like regular FILE object.

    However, there is downside: this function seems linux-specific (but it can be found in arduino, so I'm a bit confused about its status), so you don't have it on other systems. But there is some implementations for them (check libconfuse for window or for apple OSes).

提交回复
热议问题