问题
Does anyone know how to detect various .ogg file properties such as the number of channels, bits per channel, and the sample rate?
I would like to do this without using DirectX, can anyone recommend a library that could do it. Can anyone recommend an open-source library that could do it, which could be called from managed code ?
回答1:
I think NAudio can do this, but I'm not entirely sure. I know it can encode audio to ogg, but I'm not sure if it can read existing ogg files.
A StackOverflow user has posted a piece of code for working with ogg files: https://stackoverflow.com/a/8152967/14606
回答2:
Figured it out and wrote about it:
http://ellismis.com/2012/01/06/using-c-net-to-detect-ogg-vorbis-file-properties/
回答3:
Don't know of a library, but the file format looks pretty sane. You should be able to write some fairly trivial code to do this.
See http://en.wikipedia.org/wiki/Ogg#File_format
来源:https://stackoverflow.com/questions/8668767/using-net-to-detect-ogg-file-properties-number-of-channels-bits-per-channel