Quantcast
Channel: NVorbis
Viewing all articles
Browse latest Browse all 299

New Post: How to decode OGG to Wav from byte array properly?

$
0
0
Three options:
  1. Wrap the byte data in a MemoryStream: var oggStream = new MemoryStream(oggData);
  2. Change the custom file format reader to return a stream that reads data as needed (preferred)
  3. Implement NVorbis.IPacketProvider in the custom file format reader (advanced)
In all cases, you pass the stream / instance into the NVorbis.VorbisReader constructor and call ReadSamples to decode from there. The decoded data is 32-bit float PCM, and can be played by most audio libraries without further processing.

If you want to try option # 3, I have further comments. It is probably unnecessary, but since you are writing your own file format there is the possibility.

Viewing all articles
Browse latest Browse all 299

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>