2
HOW TO ACTIVATE LIBSAMPLERATE
3
(a.k.a SRC/Secret Rabbit Code)
4
AS PJMEDIA'S SAMPLE RATE CONVERSION BACKEND
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.
19
libsamplerate is available for Win32 with Visual Studio and the
20
Makefile based targets (such as Linux, MacOS X, *nix, etc.).
22
It's not supported for WinCE/Windows Mobile and Symbian since it is
23
a floating point based implementation.
28
- Download libsamplerate from http://www.mega-nerd.com/SRC/index.html
30
- Untar libsamplerate-0.1.2.tar.gz into third_party directory
32
tar xzf libsamplerate-0.1.2.tar.gz
34
- Rename libsamplerate-0.1.2 directory name to libsamplerate
36
ren libsamplerate-0.1.2 libsamplerate
38
On Linux/Unix/MacOS X:
39
mv libsamplerate-0.1.2 libsamplerate
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.
50
To build libresample static library with Visual Studio:
52
- Open third_party/build/samplerate/libsamplerate_static.dsp
53
- Build the project for both Debug and Release build
56
libresample dynamic library can be produced by following the
57
instructions in libresample source directory.
62
- Build and install libsamplerate (configure && make && make install).
63
Please follow the instructions in libsamplerate documentation.
65
- Re-run PJSIP's "configure" script with this option:
67
./configure --enable-libsamplerate
69
this will detect the presence of libsamplerate library and add it
70
to the input library list.
73
Enabling libsamplerate for PJMEDIA's resample
74
---------------------------------------------
75
For both Visual Studio and Makefile based build system, add this in
78
#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBSAMPLERATE
83
Sample 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.