initial commit

This commit is contained in:
Dan Bastone committed 2021-10-29 14:41:03 -04:00
commit 636959b37b
2474 files changed
+1343178

No files matched your search

@@ -0,0 +1,85 @@
HOW TO ACTIVATE LIBSAMPLERATE
(a.k.a SRC/Secret Rabbit Code)
AS PJMEDIA'S SAMPLE RATE CONVERSION BACKEND
by
Benny Prijono
PJSIP
Background
----------
Secret Rabbit Code (aka libsamplerate) is a sample rate conversion
library, available from http://www.mega-nerd.com/SRC/index.html.
It is licensed under dual license, GPL and proprietary.
Supported Platforms
-------------------
libsamplerate is available for Win32 with Visual Studio and the
Makefile based targets (such as Linux, MacOS X, *nix, etc.).
It's not supported for WinCE/Windows Mobile and Symbian since it is
a floating point based implementation.
Installation
------------
- Download libsamplerate from http://www.mega-nerd.com/SRC/index.html
- Untar libsamplerate-0.1.2.tar.gz into third_party directory
cd third_party
tar xzf libsamplerate-0.1.2.tar.gz
- Rename libsamplerate-0.1.2 directory name to libsamplerate
On Windows:
ren libsamplerate-0.1.2 libsamplerate
On Linux/Unix/MacOS X:
mv libsamplerate-0.1.2 libsamplerate
Visual Studio Build
-------------------
For Visual Studio projects, only static linkage is supported
by PJMEDIA build system. If dynamic linking is desired, edit
pjmedia/src/pjmedia/resample_libresample.c to prevent it from
linking with the static library, and configure your project
to link with libsamplerate DLL library.
To build libresample static library with Visual Studio:
- Open third_party/build/samplerate/libsamplerate_static.dsp
- Build the project for both Debug and Release build
libresample dynamic library can be produced by following the
instructions in libresample source directory.
Makefile build
--------------
- Build and install libsamplerate (configure && make && make install).
Please follow the instructions in libsamplerate documentation.
- Re-run PJSIP's "configure" script with this option:
./configure --enable-libsamplerate
this will detect the presence of libsamplerate library and add it
to the input library list.
Enabling libsamplerate for PJMEDIA's resample
---------------------------------------------
For both Visual Studio and Makefile based build system, add this in
config_site.h:
#define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBSAMPLERATE
Limitations
-----------
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.
@@ -0,0 +1,138 @@
!IF "$(OS)" == "Windows_NT"
NULL=
!ELSE
NULL=nul
!ENDIF
CPP=cl.exe
RSC=rc.exe
F90=df.exe
BSC32=bscmake.exe
BSC32_SBRS= \
LIB32=link.exe -lib
OUTDIR_REL=.\output\libsamplerate-i386-win32-vc-release
INTDIR_REL=.\output\libsamplerate-i386-win32-vc-release
OUTDIR_DEB=.\output\libsamplerate-i386-win32-vc-debug
INTDIR_DEB=.\output\libsamplerate-i386-win32-vc-debug
LIB_REL=..\..\lib\libsamplerate-i386-win32-vc-release.lib
LIB_DEB=..\..\lib\libsamplerate-i386-win32-vc-debug.lib
ALL : $(LIB_REL) $(LIB_DEB)
CLEAN :
-@erase "$(INTDIR_REL)\*.obj"
-@erase "$(INTDIR_REL)\*.pch"
-@erase "$(INTDIR_REL)\*.pdb"
-@erase "$(INTDIR_REL)\*.idb"
@rmdir $(INTDIR_REL)
-@erase "$(INTDIR_DEB)\*.obj"
-@erase "$(INTDIR_DEB)\*.pch"
-@erase "$(INTDIR_DEB)\*.pdb"
-@erase "$(INTDIR_DEB)\*.idb"
@rmdir $(INTDIR_DEB)
-@erase $(LIB_REL)
-@erase $(LIB_DEB)
"$(OUTDIR_REL)" :
if not exist "$(OUTDIR_REL)/$(NULL)" mkdir "$(OUTDIR_REL)"
CPP_PROJ_REL=/nologo /MD /W3 /GX /O2 /I "../win32" /I "../../libsamplerate/src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR_REL)\libsamplerate_static.pch" /YX /Fo"$(INTDIR_REL)\\" /Fd"$(INTDIR_REL)\\" /FD /c
LIB32_FLAGS_REL=/nologo /out:$(LIB_REL)
LIB32_OBJS_REL= \
"$(INTDIR_REL)\samplerate.obj" \
"$(INTDIR_REL)\src_linear.obj" \
"$(INTDIR_REL)\src_sinc.obj" \
"$(INTDIR_REL)\src_zoh.obj"
$(LIB_REL) : "$(OUTDIR_REL)" $(DEF_FILE) $(LIB32_OBJS_REL)
$(LIB32) @<<
$(LIB32_FLAGS_REL) $(DEF_FLAGS) $(LIB32_OBJS_REL)
<<
"$(OUTDIR_DEB)" :
if not exist "$(OUTDIR_DEB)/$(NULL)" mkdir "$(OUTDIR_DEB)"
CPP_PROJ_DEB=/nologo /MTd /W3 /Gm /GX /ZI /Od /I "../win32" /I "../../libsamplerate/src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /Fp"$(INTDIR_DEB)\libsamplerate_static.pch" /YX /Fo"$(INTDIR_DEB)\\" /Fd"$(INTDIR_DEB)\\" /FD /GZ /c
LIB32_FLAGS_DEB=/nologo /out:$(LIB_DEB)
LIB32_OBJS_DEB= \
"$(INTDIR_DEB)\samplerate.obj" \
"$(INTDIR_DEB)\src_linear.obj" \
"$(INTDIR_DEB)\src_sinc.obj" \
"$(INTDIR_DEB)\src_zoh.obj"
$(LIB_DEB) : "$(OUTDIR_DEB)" $(DEF_FILE) $(LIB32_OBJS_DEB)
$(LIB32) @<<
$(LIB32_FLAGS_DEB) $(DEF_FLAGS) $(LIB32_OBJS_DEB)
<<
..\..\libsamplerate\src\samplerate.c : \
"..\..\libsamplerate\src\common.h"\
"..\..\libsamplerate\src\config.h"\
"..\..\libsamplerate\src\float_cast.h"\
"..\..\libsamplerate\src\samplerate.h"\
..\..\libsamplerate\src\src_linear.c : \
"..\..\libsamplerate\src\common.h"\
"..\..\libsamplerate\src\config.h"\
"..\..\libsamplerate\src\float_cast.h"\
"..\..\libsamplerate\src\samplerate.h"\
..\..\libsamplerate\src\src_sinc.c : \
"..\..\libsamplerate\src\common.h"\
"..\..\libsamplerate\src\config.h"\
"..\..\libsamplerate\src\fastest_coeffs.h"\
"..\..\libsamplerate\src\float_cast.h"\
"..\..\libsamplerate\src\high_qual_coeffs.h"\
"..\..\libsamplerate\src\mid_qual_coeffs.h"\
"..\..\libsamplerate\src\samplerate.h"\
..\..\libsamplerate\src\src_zoh.c : \
"..\..\libsamplerate\src\common.h"\
"..\..\libsamplerate\src\config.h"\
"..\..\libsamplerate\src\float_cast.h"\
"..\..\libsamplerate\src\samplerate.h"\
SOURCE=..\..\libsamplerate\src\samplerate.c
"$(INTDIR_DEB)\samplerate.obj" : $(SOURCE) "$(INTDIR_DEB)"
$(CPP) $(CPP_PROJ_DEB) $(SOURCE)
"$(INTDIR_REL)\samplerate.obj" : $(SOURCE) "$(INTDIR_REL)"
$(CPP) $(CPP_PROJ_REL) $(SOURCE)
SOURCE=..\..\libsamplerate\src\src_linear.c
"$(INTDIR_DEB)\src_linear.obj" : $(SOURCE) "$(INTDIR_DEB)"
$(CPP) $(CPP_PROJ_DEB) $(SOURCE)
"$(INTDIR_REL)\src_linear.obj" : $(SOURCE) "$(INTDIR_REL)"
$(CPP) $(CPP_PROJ_REL) $(SOURCE)
SOURCE=..\..\libsamplerate\src\src_sinc.c
"$(INTDIR_DEB)\src_sinc.obj" : $(SOURCE) "$(INTDIR_DEB)"
$(CPP) $(CPP_PROJ_DEB) $(SOURCE)
"$(INTDIR_REL)\src_sinc.obj" : $(SOURCE) "$(INTDIR_REL)"
$(CPP) $(CPP_PROJ_REL) $(SOURCE)
SOURCE=..\..\libsamplerate\src\src_zoh.c
"$(INTDIR_DEB)\src_zoh.obj" : $(SOURCE) "$(INTDIR_DEB)"
$(CPP) $(CPP_PROJ_DEB) $(SOURCE)
"$(INTDIR_REL)\src_zoh.obj" : $(SOURCE) "$(INTDIR_REL)"
$(CPP) $(CPP_PROJ_REL) $(SOURCE)
@@ -0,0 +1,114 @@
# Microsoft Developer Studio Project File - Name="libsamplerate_static" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=libsamplerate_static - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "libsamplerate_static.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "libsamplerate_static.mak" CFG="libsamplerate_static - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "libsamplerate_static - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "libsamplerate_static - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "libsamplerate_static - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "output/libsamplerate-i386-win32-vc-release"
# PROP BASE Intermediate_Dir "output/libsamplerate-i386-win32-vc-release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "output/libsamplerate-i386-win32-vc-release"
# PROP Intermediate_Dir "output/libsamplerate-i386-win32-vc-release"
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "./win32" /I "../../libsamplerate/src" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\lib\libsamplerate-i386-win32-vc-release.lib"
!ELSEIF "$(CFG)" == "libsamplerate_static - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "output/libsamplerate-i386-win32-vc-debug"
# PROP BASE Intermediate_Dir "output/libsamplerate-i386-win32-vc-debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "output/libsamplerate-i386-win32-vc-debug"
# PROP Intermediate_Dir "output/libsamplerate-i386-win32-vc-debug"
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "./win32" /I "../../libsamplerate/src" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\..\lib\libsamplerate-i386-win32-vc-debug.lib"
!ENDIF
# Begin Target
# Name "libsamplerate_static - Win32 Release"
# Name "libsamplerate_static - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=..\..\libsamplerate\src\samplerate.c
# End Source File
# Begin Source File
SOURCE=..\..\libsamplerate\src\src_linear.c
# End Source File
# Begin Source File
SOURCE=..\..\libsamplerate\src\src_sinc.c
# End Source File
# Begin Source File
SOURCE=..\..\libsamplerate\src\src_zoh.c
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\libsamplerate\src\samplerate.h
# End Source File
# End Group
# End Target
# End Project