README.txt 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. HOW TO ACTIVATE LIBSAMPLERATE
  2. (a.k.a SRC/Secret Rabbit Code)
  3. AS PJMEDIA'S SAMPLE RATE CONVERSION BACKEND
  4. by
  5. Benny Prijono
  6. PJSIP
  7. Background
  8. ----------
  9. Secret Rabbit Code (aka libsamplerate) is a sample rate conversion
  10. library, available from http://www.mega-nerd.com/SRC/index.html.
  11. It is licensed under the 2-clause BSD license (initially it was
  12. licensed under dual license, GPL and proprietary).
  13. Supported Platforms
  14. -------------------
  15. libsamplerate is available for Win32 with Visual Studio and the
  16. Makefile based targets (such as Linux, MacOS X, *nix, etc.).
  17. It's not supported for WinCE/Windows Mobile and Symbian since it is
  18. a floating point based implementation.
  19. Installation
  20. ------------
  21. - Download libsamplerate from http://www.mega-nerd.com/SRC/index.html
  22. - Untar libsamplerate-0.1.2.tar.gz into third_party directory
  23. cd third_party
  24. tar xzf libsamplerate-0.1.2.tar.gz
  25. - Rename libsamplerate-0.1.2 directory name to libsamplerate
  26. On Windows:
  27. ren libsamplerate-0.1.2 libsamplerate
  28. On Linux/Unix/MacOS X:
  29. mv libsamplerate-0.1.2 libsamplerate
  30. Visual Studio Build
  31. -------------------
  32. For Visual Studio projects, only static linkage is supported
  33. by PJMEDIA build system. If dynamic linking is desired, edit
  34. pjmedia/src/pjmedia/resample_libresample.c to prevent it from
  35. linking with the static library, and configure your project
  36. to link with libsamplerate DLL library.
  37. To build libresample static library with Visual Studio:
  38. - Open third_party/build/samplerate/libsamplerate_static.dsp
  39. - Build the project for both Debug and Release build
  40. libresample dynamic library can be produced by following the
  41. instructions in libresample source directory.
  42. Makefile build
  43. --------------
  44. - Build and install libsamplerate (configure && make && make install).
  45. Please follow the instructions in libsamplerate documentation.
  46. - Re-run PJSIP's "configure" script with this option:
  47. ./configure --enable-libsamplerate
  48. this will detect the presence of libsamplerate library and add it
  49. to the input library list.
  50. Enabling libsamplerate for PJMEDIA's resample
  51. ---------------------------------------------
  52. For both Visual Studio and Makefile based build system, add this in
  53. config_site.h:
  54. #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBSAMPLERATE
  55. Limitations
  56. -----------
  57. 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.