khalzam

Simple audio recognition library.

Github星跟踪图

Khalzam

This library is very poorly designed and was written purely as proof-of-concept.
I have rewritten it in Rust and the main development is going here.

About

Khalzam is a simple audio recognition library. Its algrorithm is based on
this article by Jovan Jovanovic

Dependencies

Fingerprint library uses mpg123 (thinking of switching to a native solution) so you need to install it:

macOS (Homebrew)

$ brew install mpg123

Debian

$ sudo apt-get install libmpg123-dev

Setup

You need to create and initialize database:

$ createdb -O user databasename
$ psql -f createdb.sql databasename

Usage

Shell mode

$ DBUSER=kisasexypantera94 DBNAME=khalzam go run shell.go
Initializing library...

MusicLibrary interactive shell
>>> help

Commands:
  clear             clear the screen
  delete            delete audio from database
  exit              exit the program
  help              display help
  index             index audiofile
  indexdir          index directory
  recognize         recognize audiofile
  recognizedir      recognize directory


>>> index resources/Modjo\ -\ Lady\ \(Hear\ Me\ Tonight\).mp3
Indexing 'resources/Modjo - Lady (Hear Me Tonight).mp3'...
>>> recognize samples/modjo_lady_sample.mp3
Recognizing 'samples/modjo_lady_sample.mp3'...
Best match: Modjo - Lady (Hear Me Tonight) (11% matched)

API

package main

import (
	"fmt"
	"github.com/kisasexypantera94/khalzam/musiclibrary"
	_ "github.com/lib/pq"
)

func main() {
	cfg := &musiclibrary.Config{
		User:     os.Getenv("DBUSER"),
		Password: os.Getenv("DBPASSWORD"),
		DBname:   os.Getenv("DBNAME"),
		Host:     os.Getenv("DBHOST"),
		Port:     os.Getenv("DBPORT"),
	}

	musicLib, _ := musiclibrary.Open(cfg)
	defer musicLib.Close()

	musicLib.Index("resources/Modjo - Lady (Hear Me Tonight).mp3")
	result := musicLib.Recognize("samples/modjo_lady_sample.mp3")
	fmt.Println(result)
}

主要指标

概览
名称与所有者kisasexypantera94/khalzam
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2018-12-24 03:55:34
推送于2019-08-18 14:02:12
最后一次提交2019-08-18 17:02:05
发布数0
用户参与
星数46
关注者数0
派生数1
提交数27
已启用问题?
问题数0
打开的问题数0
拉请求数0
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?