Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
sndfile.cc
Go to the documentation of this file.
1 // This Source Code Form is licensed MPL-2.0: http://mozilla.org/MPL/2.0
2#include "testing.hh"
3#include "internal.hh"
4
5#include "external/libsndfile/include/sndfile.hh"
6
7#include "libsndfile/config.h"
8
9#define SDEBUG(...) Ase::debug ("sndfile", __VA_ARGS__)
10
11// Check libsndfile configuration in local build
12#ifndef HAVE_EXTERNAL_XIPH_LIBS
13#error "libsndfile requires Flac, Ogg, Vorbis, Opus headers"
14#endif
15#ifndef HAVE_MPEG
16#error "libsndfile requires libmpg123 and libmp3lame"
17#endif
18
19// Check libsndfile-1.1.0 header features
20static_assert (SF_FORMAT_MPEG >= 0x230000, "libsndfile required with MP3 support");
21
22namespace Ase {
23
25libsndfile_version ()
26{
27 char sndfileversion[256] = { 0, };
28 sf_command (nullptr, SFC_GET_LIB_VERSION, sndfileversion, sizeof (sndfileversion));
29 return sndfileversion;
30}
31
32} // Ase
33
34// == tests ==
35namespace {
36using namespace Ase;
37
38TEST_INTEGRITY (sndfile_tests);
39static void
40sndfile_tests()
41{
42 const String sndfileversion = libsndfile_version();
43 SDEBUG ("SFC_GET_LIB_VERSION: %s\n", sndfileversion);
44}
45
46} // Anon
47
#define TEST_INTEGRITY(FUNC)
Register func as an integrity test.
Definition internal.hh:77
The Anklang C++ API namespace.
Definition api.hh:9