blob: 0f8de07b89b381d1f55fd3e9bdc426cde2764d57 [file] [log] [blame]
Benny Prijono899f9af2007-10-12 05:24:32 +00001
2 HOW TO ACTIVATE LIBSAMPLERATE
3 (a.k.a SRC/Secret Rabbit Code)
4 AS PJMEDIA'S SAMPLE RATE CONVERSION BACKEND
5
6 by
7 Benny Prijono
8 PJSIP
9
10Background
11----------
12 Secret Rabbit Code (aka libsamplerate) is a sample rate conversion
13 library, available from http://www.mega-nerd.com/SRC/index.html.
14 It is licensed under dual license, GPL and proprietary.
15
16
17Supported Platforms
18-------------------
19 libsamplerate is available for Win32 with Visual Studio and the
20 Makefile based targets (such as Linux, MacOS X, *nix, etc.).
21
22 It's not supported for WinCE/Windows Mobile and Symbian since it is
23 a floating point based implementation.
24
25
26Installation
27------------
28 - Download libsamplerate from http://www.mega-nerd.com/SRC/index.html
29
30 - Untar libsamplerate-0.1.2.tar.gz into third_party directory
31 cd third_party
32 tar xzf libsamplerate-0.1.2.tar.gz
33
34 - Rename libsamplerate-0.1.2 directory name to libsamplerate
35 On Windows:
36 ren libsamplerate-0.1.2 libsamplerate
37
38 On Linux/Unix/MacOS X:
39 mv libsamplerate-0.1.2 libsamplerate
40
41
42Visual Studio Build
43-------------------
44 For Visual Studio projects, only static linkage is supported
45 by PJMEDIA build system. If dynamic linking is desired, edit
46 pjmedia/src/pjmedia/resample_libresample.c to prevent it from
47 linking with the static library, and configure your project
48 to link with libsamplerate DLL library.
49
50 To build libresample static library with Visual Studio:
51
52 - Open third_party/build/samplerate/libsamplerate_static.dsp
53 - Build the project for both Debug and Release build
54
55
56 libresample dynamic library can be produced by following the
57 instructions in libresample source directory.
58
59
60Makefile build
61--------------
Benny Prijono550a1a62007-10-16 08:54:00 +000062 - Build and install libsamplerate (configure && make && make install).
63 Please follow the instructions in libsamplerate documentation.
Benny Prijono899f9af2007-10-12 05:24:32 +000064
Benny Prijono550a1a62007-10-16 08:54:00 +000065 - Re-run PJSIP's "configure" script with this option:
66
67 ./configure --enable-libsamplerate
68
69 this will detect the presence of libsamplerate library and add it
70 to the input library list.
Benny Prijono899f9af2007-10-12 05:24:32 +000071
72
73Enabling libsamplerate for PJMEDIA's resample
74---------------------------------------------
Benny Prijono550a1a62007-10-16 08:54:00 +000075 For both Visual Studio and Makefile based build system, add this in
76 config_site.h:
Benny Prijono899f9af2007-10-12 05:24:32 +000077
78 #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBSAMPLERATE
79
80
Benny Prijonod224f9d2007-10-18 01:58:38 +000081Limitations
82-----------
83Sample rate 22050 Hz is only supported with 20ms ptime, and sample rate 11025 Hz is only supported with 40ms ptime. This is the limitation of PJMEDIA rather than libsamplerate.
84
Benny Prijono899f9af2007-10-12 05:24:32 +000085