Acoustid Audio Fingerprint Environment configuration--server

Source: Internet
Author: User
Tags psql postgres createdb install redis

Configure the server side of the Acoustid open source project, including two parts: Acoustid-server and Acoustid-index.

Refer to Https://bitbucket.org/acoustid/acoustid-server respectively

Https://bitbucket.org/acoustid/acoustid-index

# # #acoustid-server Configuration # # #

#下载源代码, install dependent packages

git clone https://bitbucket.org/acoustid/acoustid-serer.gitsudo apt-get install PostgreSQL Postgresql-contribsudo Apt-get Install redis-serversudo apt-get install python python-dev python-virtualenvsudo apt-get Install Postgresql-9.1-acoustid

#配置Python虚拟环境

Virtualenv esource E/bin/activatepip insatll-r requirements.txt

#配置postgresql数据库

Sudo-u postgres createuser acoustidsudo-u postgres createdb-o Acoustid acoustid# This creates a user named Acoustid, respectively. and a database named Acoustid psql-u postgresalter user acoustid with password ' yourpassword '; #登录postgresql, modify the Acoustid password

#修改配置文件

CP acoustid.conf.dist Acoustid.confvim acoustid.conf #修改配置文件为上步修改的密码, Password=yourpassword

#在数据库中添加扩展应用

Sudo-u postgres psql acoustid-c ' Create EXTENSION intarray '; sudo-u postgres psql acoustid-c ' Create EXTENSION pgcrypto '; sudo-u postgres psql acoustid-c ' CREATE EXTENSION acoustid ';

#创建数据库的表结构

./run_psql.sh < sql/createtables.sql./run_psql.sh < sql/createprimarykeys.sql./run_psql.sh < sql/ createfkconstraints.sql./run_psql.sh < Sql/createindexes.sql

#测试运行

./run_web.sh--host=0.0.0.0

#如运行无误, the next configuration is possible

# # #acoustid-index Configuration # # #

#下载源代码, installing

git clone https://bitbucket.org/acoustid/acoustid-index.gitcmake. Make && make install

#测试运行

./fpi-server

# # #总的Server端环境测试 # #

#分别开启acoustid-server and Acoustid-index Services

./run_web.sh--api./fpi-server

#开启服务后, you can access the server-side API interface via a Web page, which is Acoustid's web-service. The URL is: http://127.0.0.1:5000/api/ws/v2/lookup?client=xxx&duration=xxx&fingerprint=***

Where http://127.0.0.1:5000/api/ws/v2/is the interface prefix, then lookup and submit call query and commit handler function respectively, client, duration, fingerprint are the corresponding parameters. You can view acoustid-server/acoustid/server.py in detail. The parameters of the client can be added to the Account table of the PostgreSQL database Acoustid, duration and fingerprint can be obtained by calculating the fingerprint information of the audio file by Chromaprint.

In order for the submission to be submitted to the database, you also need to modify the Submithandler function in acoustid-server/acoustid/api/v2/__init__.py.

The lookup query information can also be adjusted by modifying the Lookuphandler function in acoustid-server/acoustid/api/v2/__init__.py.

  

  

  

Acoustid Audio Fingerprint Environment configuration--server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.