wiki:External_Sound_Device
Last modified 9 years ago Last modified on 07/28/08 17:56:13

Enabling External Sound Device Configurations

External sound device configuration enables application to provide its own sound device implementation rather than the implementation provided by PJMEDIA. This option was added in PJSIP version 0.9.5.

GNU Build System

Follow these steps to enable external sound device with GNU build system.

  1. Enable external sound device in ./configure command:
    ./configure --enable-ext-sound
    
  2. Edit user.mak in root PJSIP directory to add your sound device implementation in the link process. For example, if your sound device implementation is in ext_snd.c in your home directory, the content of user.mak file will look something like this:
    # This is the rule to compile your sound implementation
    ~/ext_snd.o: ~/ext_snd.c
            $(APP_CC) $(APP_CFLAGS) -c $< -o $@
    
    # Specify this so that your file will be compiled when 'make all' is invoked
    all:    ~/ext_snd.o
    
    # Add your implementation to LDFLAGS
    export LDFLAGS += ~/ext_snd.o
    
    
    Note that all directory reference must use full path rather than relative path, since the make command will be invoked in build directory of the libraries rather than in root PJSIP directory.
  3. Build everything:
    make
    

Visual Studio and Others

Follow these steps to enable external sound device with Visual Studio build system.

  1. Declare this in your config_site.h:
    #define PJMEDIA_SOUND_IMPLEMENTATION    PJMEDIA_SOUND_EXTERNAL
    
  2. Add your sound device implementation source file in the application project (e.g. in application's Visual Studio project, or in application's MMP file for Symbian).