3

libsndfile is a C library for reading and writing WAV files, and it also includes a C++ wrapper, which I'd like to use.

However, although the C API documentation is very thorough, I cannot figure out how to use the C++ wrapper to read audio files (though there are examples on the web about writing).

Is there any actual documentation or examples using this API? Or should I just give up on using this wrapper, and instead use the C API directly?

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
LeeG
  • 265
  • 1
  • 4
  • 11
  • 2
    What, Google not available in your country? First result for `libsndfile` says: "A C library for reading and writing files containing sampled sound. Project news, features list, API reference, FAQ, and download. [LGPL]". The same website is the linked to in the article you cited, underneath the very first mention of the text "libsndfile". – Lightness Races in Orbit Jul 14 '13 at 21:50
  • 2
    This Question is specifically about the C++ api that is included with libsndfile. `sndfile.hh` – LeeG Jul 14 '13 at 21:52
  • 2
    @LeeG: Sorry, that's true. My lack of familiarity with the library meant I did not pick that up from your question, which I've now edited to make a little clearer. Indeed there doesn't seem to be official documentation for the C++ wrapper. For what it's worth, that seems to have been the rationale behind that blog post. +1 – Lightness Races in Orbit Jul 14 '13 at 21:53

1 Answers1

4

There is an example program here: https://github.com/erikd/libsndfile/blob/master/examples/sndfilehandle.cc

  • 2
    Interesting, the way files are read in the example isn't quite what I'd expect. If I have the chance I'll play around with this example this weekend and see if this works correctly. – LeeG Jul 25 '13 at 22:00