2012-01-15 09:34:46 +00:00
|
|
|
# libsndfile
|
|
|
|
|
2016-02-02 17:45:08 +00:00
|
|
|
[![Build Status](https://secure.travis-ci.org/erikd/libsndfile.svg?branch=master)](http://travis-ci.org/erikd/libsndfile)
|
2015-08-07 09:48:51 +00:00
|
|
|
|
2012-01-15 09:34:46 +00:00
|
|
|
libsndfile is a C library for reading and writing files containing sampled audio
|
|
|
|
data.
|
|
|
|
|
|
|
|
## Hacking
|
|
|
|
|
2012-01-15 10:23:56 +00:00
|
|
|
The canonical source code repository for libsndfile is at
|
|
|
|
[https://github.com/erikd/libsndfile/][github].
|
2012-01-15 09:34:46 +00:00
|
|
|
|
2012-01-15 10:23:56 +00:00
|
|
|
You can grab the source code using:
|
2012-01-15 09:34:46 +00:00
|
|
|
|
2012-01-15 10:23:56 +00:00
|
|
|
$ git clone git://github.com/erikd/libsndfile.git
|
|
|
|
|
2016-07-16 09:34:17 +00:00
|
|
|
For building for Android see [BuildingForAndroid][BuildingForAndroid].
|
|
|
|
|
2016-07-02 07:18:37 +00:00
|
|
|
There are currently two build systems; the official GNU autotool based one and
|
|
|
|
a more limited and experimental CMake based build system. Use of the CMake build
|
|
|
|
system is documented below.
|
|
|
|
|
2016-07-26 08:41:17 +00:00
|
|
|
Setting up a build environment for libsndfile on Debian or Ubuntu is as simple as:
|
|
|
|
```
|
2016-07-28 11:15:59 +00:00
|
|
|
sudo apt install autoconf autogen automake build-essential libasound2-dev \
|
|
|
|
libflac-dev libogg-dev libtool libvorbis-dev pkg-config python
|
2016-07-26 08:41:17 +00:00
|
|
|
````
|
|
|
|
For other Linux distributions or any of the *BSDs, the setup should be similar
|
|
|
|
although the package install tools and package names may be slightly different.
|
|
|
|
|
|
|
|
Similarly on Mac OS X, assuming [brew] is already installed:
|
|
|
|
```
|
|
|
|
brew install autoconf autogen automake flac libogg libtool libvorbis pkg-config
|
|
|
|
```
|
|
|
|
Once the build environment has been set up, building and testing libsndfile is
|
|
|
|
as simple as:
|
2012-01-15 10:23:56 +00:00
|
|
|
|
|
|
|
$ ./autogen.sh
|
2016-07-26 08:41:17 +00:00
|
|
|
$ ./configure --enable-werror
|
2012-01-15 10:23:56 +00:00
|
|
|
$ make
|
|
|
|
$ make check
|
|
|
|
|
2016-07-02 07:18:37 +00:00
|
|
|
|
|
|
|
## The CMake build system.
|
|
|
|
|
|
|
|
The CMake build system is still experimental and probably only works on linux
|
|
|
|
because it still relies on GNU autotools for bootstrapping. Using it as simple
|
|
|
|
as:
|
|
|
|
|
|
|
|
$ Scripts/cmake-build.sh
|
|
|
|
|
2016-07-26 08:41:17 +00:00
|
|
|
I would be happy to accept patches to make the CMake build system more portable.
|
2016-07-02 07:18:37 +00:00
|
|
|
|
|
|
|
|
2012-01-15 10:23:56 +00:00
|
|
|
## Submitting Patches.
|
|
|
|
|
2012-01-20 08:39:16 +00:00
|
|
|
* Patches should pass all pre-commit hook tests.
|
|
|
|
* Patches should always be submitted via a either Github "pull request" or a
|
|
|
|
via emailed patches created using "git format-patch".
|
2012-01-15 11:13:33 +00:00
|
|
|
* Patches for new features should include tests and documentation.
|
|
|
|
* Patches to fix bugs should either pass all tests, or modify the tests in some
|
|
|
|
sane way.
|
2012-01-20 08:39:16 +00:00
|
|
|
* When a new feature is added for a particular file format and that feature
|
|
|
|
makes sense for other formats, then it should also be implemented for one
|
|
|
|
or two of the other formats.
|
2012-01-15 11:13:33 +00:00
|
|
|
|
|
|
|
|
2012-01-15 10:23:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2016-07-26 08:41:17 +00:00
|
|
|
[brew]: http://brew.sh/
|
2012-01-15 09:34:46 +00:00
|
|
|
[github]: https://github.com/erikd/libsndfile/
|
2016-07-16 09:34:17 +00:00
|
|
|
[BuildingForAndroid]: https://github.com/erikd/libsndfile/blob/master/Building-for-Android.md
|