• Home
  • Documents
  • Download
  • Status
  • FAQ
  • Mailing list
  • Applications
  • Links
  • License
  • Volunteer
  • Contacts

Compilation on Apple Mac OS X

Compile CIOS Audio Core library

It is easy to compile the CIOS Audio Core when the environment is ready:

mkdir BuildCiosAudioCore

cd BuildCiosAudioCore

cmake $CIOSAUDIOROOTDIR/Compile/MacOSX

make

sudo make install

This will install CiosAudio.hpp to "/usr/local/include", and libCaCore.a to "/usr/local/lib".

Modify settings

If you like to modify the settings, we suggest you use "cmake-gui". If you need to use parameters by command line, please go to CMake official site http://www.cmake.org and read related documents


cd Somewhere/Temporary mkdir CiosAudio

cd CiosAudio

cmake $CIOSAUDIOROOTDIR/Compile/MacOSX

cd ..

cmake-gui CiosAudio

The interface appears like the following:


Then, change what you need:

Press Configure:

Press Generate:


Then, issue the commands:

cd CiosAudio

make

make install



Modify default Namespace

The default namespace of CIOS Audio Core is CiosAudio. You can modify namespace by the following methods:

cd Somewhere/Temporary mkdir CiosAudio

cd CiosAudio

cmake CMAKE_CXX_FLAGS="-DCAC_NAMESPACE=MyCaAudio" $CIOSAUDIOROOTDIR/Compile/MacOSX

cd ..

cmake-gui CiosAudio


Utilities and FFmpeg

If you want to enable FFmpeg, you will have to enable Utilities too.

Compile CIOS Audio Core applications


Applications must link with "libCaCore.a". And because we use Apple Core Audio as the underlying mechanism, you must link with the following four frameworks:
  • CoreAudio
  • CoreServices
  • AudioUnit
  • AudioToolBox


If you are using FFmpeg, you must understand your FFmpeg link with what extra libraries, details please refer Compiling FFmpeg. In most cases, the following libraries are to be linked:
  • avcodec
  • avformat
  • avutil
  • swresample
  • swscale
  • iconv
  • z
  • bz2
  • mp3lame
  • twolame
  • gsm

If you do not actually know which libraries are required to be linked, ask the FFmpeg user groups, it will be a better solution.

Regular C++ program

Using library

In your Makefile, add include path and lib path, and "-lCaCore":

Embed into your C++ program

Just add the following hpp and cpp in the directory into your project file:

CiosAudio/*.hpp
CiosAudio/*.cpp
CiosAudio/Utilities/*.cpp
CiosAudio/Utilities/MacOSX/*.cpp
CiosAudio/Platforms/*.cpp
CiosAudio/Platforms/MacOSX/*.hpp
CiosAudio/Platforms/MacOSX/*.cpp


And, remember to add the library and include path for FFmpeg.

Qt

Using library

In your Qt program PRO, add the following:

INCLUDEPATH += ${WHEREVER_CIOS_AUDIO_INCLUDE_PATH}
LIBS += -L{WHEREVER_CIOS_AUDIO_LIB_PATH}
LIBS += -lCaCore
LIBS += -framework CoreAudio
LIBS += -framework CoreServices
LIBS += -framework AudioUnit
LIBS += -framework AudioToolBox


And, remember to add the library and include path for FFmpeg.

Embed into Qt program

In your Qt program PRO, add the following:

include ($${PWD}/CiosAudio/CiosAudio.pri)
LIBS += -framework CoreAudio
LIBS += -framework CoreServices
LIBS += -framework AudioUnit
LIBS += -framework AudioToolBox


And, remember to add the library and include path for FFmpeg.