Libsndfile with Xcode

Screen Shot 2016-01-11 at 1.41.15 PM

I used Macport for installing libsndfile.

% sudo port install libsndfile

% sudo find /opt/local -name "sndfile.h*" -ls
9309001       56 -rw-r--r--    1 root             admin               28172 Jan 11 12:58 /opt/local/include/sndfile.h
9309002       32 -rw-r--r--    1 root             admin               12615 Jan 11 12:58 /opt/local/include/sndfile.hh

% sudo find /opt/local -name "libsndfile.a" -ls
9308997     1192 -rw-r--r--    1 root             admin              609416 Jan 11 12:58 /opt/local/lib/libsndfile.a

% sudo SetFile -a v /opt
% sudo SetFile -a v ~/Library

The last two lines are required, becasuse Finder does not show those directories by default. (Yet another reason to dislike OS X?)

Screen Shot 2016-01-11 at 2.00.18 PM

You can add these files into your project by the menu File->Add Files to “your project”.

Then build and run the project, but where is the wavefile that was genereated?

% find . -name "SinWave.wav" -ls
9311043     1384 -rw-r--r--    1 user1            staff              705644 Jan 11 14:03 ./Library/Developer/Xcode/DerivedData/MyTestLibsndfile-epxzehlkgnfccyghceojpoehfjvu/Build/Products/Debug/SinWave.wav

Very fantastic, isn’t it?