Procedure to Create a PortAudio Passcode

Creating a PortAudio passcode in XCode 7.2 and Mac OS X 10.11 (a.k.a. El Capitan)
Phillip De Leon
2016-Feb-16
-----------------
Install PortAudio
-----------------
1. Install MacPorts
https://www.macports.org/install.php
2. From the terminal type
sudo port install portaudio
3. From the terminal type
ls /opt/local/lib/libportaudio*
and notice six files including
libportaudio.2.dylib, libportaudio.a
-----------------
Install Xcode
-----------------
1. Install Xcode
https://developer.apple.com/xcode/download/
------------------------
Create the XCode Project
------------------------

1. Open Xcode. File -> New -> New Project… -> OS X -> Application -> Command Line Tool -> Next. Product Name: passcode, Organization Name: <YOUR NAME>, Organization Identifier: edu.nmsu, Language: C -> Next. Save project where desired, check Source Control if desired -> Create.

2. Click main.c from passcode folder in left navigation pane and hit Delete. Select Move to Trash.
3. We need to add DeLeon's portaudio passcode and DSPFixedPointFunctions folder to the project. Drag initialize_program.c, main.c, process_signal.c, user_data.h, and util.h files and DSPFunctionsFloatingPoint folder to the passcode folder in left navigation pane. Check Copy items into destination folder -> Finish.
3. We need to link the binary with the AudioToolbox, AudioUnit, CoreAudio, and CoreServices frameworks. In the left navigation pane click passcode project. In the next navigation pane click passcode under TARGETS. Click Build Phases. Open the disclosure box for Link Binary with Libraries. Click + and add: CoreAudio.framework, AudioToolbox.framework, AudioUnit.framework, and CoreServices.framework frameworks. Click +, Add Other..., and navigate to /opt/local/lib. Click on libportaudio.2.dylib and hit Open.
4. We need to add search paths to portaudio. In the left navigation pane click passcode project. In the next navigation pane click passcode under TARGETS. Click Build Settings. Click All. Open the disclosure box for Search Paths. Double click the arguments line next to the Header Search Paths, click + and type /opt/local/include. If /opt/local/lib is not already listed under Library Search Paths, double click the arguments line next to the Library Search Paths, click + and type /opt/local/lib.
5. Click the Run button in the top left. You should be able to speak into the microphone and hear output on the speakers. There may be feedback in which case, use headphones instead of speakers.