近期要做一个音乐相关的client。当中一个功能是音乐识别。搜索了一些资料选择Echoprint来开发。Echoprint是开源免费的,并且多种client都支持能节约非常多时间,今天主要下载和编译源代码以及測试。
(备注:我的开发环境是Mac,所以以下以及之后都是Mac的环境)
1、官网
官网地址:http://echoprint.me
2、安装依赖环境
- 首先安装HomeBrew
- 安装依赖库
brew install ffmpeg boost taglib
安装的文件夹都在/usr/local/Cellar
3、下载源代码
git clone -b release-4.12 git://github.com/echonest/echoprint-codegen.git
adsl-172-10-1-12:~ zhangjie$ cd echoprint-codegen
adsl-172-10-1-12:echoprint-codegen zhangjie$ cd src/
adsl-172-10-1-12:src zhangjie$ vim Makefile
改动当中变量BOOST_CFLAGS为你当前安装的boost文件夹BOOST_CFLAGS=-I/usr/local/Cellar/boost/1.58.0/include
改动34 libcodegen: $(MODULES_LIB)
35 ifeq ($(UNAME),Darwin)
36 libtool -dynamic -flat_namespace -install_name libcodegen.$(VERSION).dylib -lSystem -compatibility_version $(VERSION_COMPAT) \
37 -macosx_version_min 10.6 -current_version $(VERSION) -o libcodegen.$(VERSION).dylib -undefined suppress \
38 $(MODULES_LIB) -framework vecLib -framework Accelerate
39 else
40 $(CXX) -shared -fPIC -Wl,-soname,$(SONAME) -o $(LIBNAME).$(VERSION) $(MODULES_LIB) -lz
41 endif
假设38行中有-framework vecLib则去掉变为例如以下:
34 libcodegen: $(MODULES_LIB)
35 ifeq ($(UNAME),Darwin)
36 libtool -dynamic -flat_namespace -install_name libcodegen.$(VERSION).dylib -lSystem -compatibility_version $(VERSION_COMPAT) \
37 -macosx_version_min 10.6 -current_version $(VERSION) -o libcodegen.$(VERSION).dylib -undefined suppress \
38 $(MODULES_LIB) -framework Accelerate
39 else
40 $(CXX) -shared -fPIC -Wl,-soname,$(SONAME) -o $(LIBNAME).$(VERSION) $(MODULES_LIB) -lz
41 endif
4、编译
adsl-172-10-1-12:src zhangjie$ vim Makefile
adsl-172-10-1-12:src zhangjie$ make
g++ -Wall -I/usr/local/Cellar/boost/1.58.0/include `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o Codegen.o Codegen.cxx
In file included from Codegen.cxx:12:
In file included from ./AudioBufferInput.h:14:
./AudioStreamInput.h:53:10: warning: 'StdinStreamInput::ProcessFile' hides overloaded virtual function [-Woverloaded-virtual]
bool ProcessFile(const char* filename){ return ProcessStandardInput();}
^
./AudioStreamInput.h:26:18: note: hidden overloaded virtual function 'AudioStreamInput::ProcessFile' declared here: different number of parameters (3 vs 1)
virtual bool ProcessFile(const char* filename, int offset_s=0, int seconds=0);
^
1 warning generated.
g++ -Wall -I/usr/local/Cellar/boost/1.58.0/include `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o Fingerprint.o Fingerprint.cxx
g++ -Wall -I/usr/local/Cellar/boost/1.58.0/include `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o MatrixUtility.o MatrixUtility.cxx
g++ -Wall -I/usr/local/Cellar/boost/1.58.0/include `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o SubbandAnalysis.o SubbandAnalysis.cxx
In file included from SubbandAnalysis.cxx:8:
./AudioStreamInput.h:53:10: warning: 'StdinStreamInput::ProcessFile' hides overloaded virtual function [-Woverloaded-virtual]
bool ProcessFile(const char* filename){ return ProcessStandardInput();}
^
./AudioStreamInput.h:26:18: note: hidden overloaded virtual function 'AudioStreamInput::ProcessFile' declared here: different number of parameters (3 vs 1)
virtual bool ProcessFile(const char* filename, int offset_s=0, int seconds=0);
^
1 warning generated.
g++ -Wall -I/usr/local/Cellar/boost/1.58.0/include `taglib-config --cflags` -fPIC -O3 -DBOOST_UBLAS_NDEBUG -DNDEBUG -c -o Whitening.o Whitening.cxx