Giter Club home page Giter Club logo

musig's Introduction

musig ๐Ÿ”ˆ

GoDoc CircleCI

A shazam-like tool that allows you to compute song's fingerprints and reverse lookup song names.

It's more or less an implementation of the shazam paper as described in this awesome article

Installation

You will need to have go on your computer (version > 1.11 to be able to use go modules).

You will also need to have portaudio installed (brew install portaudio on macOS, apt install portaudio19-dev on Ubuntu / Debian, for other distributions you can search for the portaudio package), it is required for the listen command that listens on your microphone to match the recording against the database.

To build the binary:

git clone [email protected]:sfluor/musig.git
cd musig
make

You will then be able to run the binary with:

./bin/musig help

Usage

musig usage

To do some testing you can download wav songs by doing make download.

Load them with ./bin/musig load "./assets/dataset/wav/*.wav"

And try to find one of your song name with:

./bin/musig read "$(ls ./assets/dataset/wav/*.wav | head -n 1)"

You can also try to use it with your microphone using the listen command:

./bin/musig listen

If you want to record a sample and reuse it multiple times after you can also use the record command:

./bin/musig record

For more details on the usage see the help command:

A shazam like CLI tool

Usage:
  musig [command]

Available Commands:
  help        Help about any command
  listen      listen will record the microphone input and try to find a matching song from the database (Ctrl-C will stop the recording)
  load        Load loads all the audio files matching the provided glob into the database (TODO: only .wav are supported for now)
  read        Read reads the given audio file trying to find it's song name
  record      record will record the microphone input and save the signal to the given file
  spectrogram spectrogram generate a spectrogram image for the given audio file in png (TODO: only .wav are supported for now)

Flags:
      --database string   database file to use (default "/tmp/musig.bolt")
  -h, --help              help for musig

Use "musig [command] --help" for more information about a command.

Testing

To run the tests you can use make test in the root directory.

TODOs

  • improve the documentation
  • support for mp3 files

musig's People

Contributors

0xflotus avatar sfluor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

musig's Issues

Segfault on 24bit files

Greetings!

It looks like parseRawData() segfaults on 24bit wav files, because there's no conversion function defined here

	byteSizeToIntFunc = map[int]bytesToIntF{
		16: bits16ToInt,
		32: bits32ToInt,
	}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10a3643]

goroutine 1 [running]:
github.com/DylanMeeus/GoAudio/wave.parseRawData(0xc00010000c, 0x4, 0x102880, 0x10, 0x1, 0x2, 0xac44, 0x40998, 0x6, 0x18, ...)
	...go/pkg/mod/github.com/!dylan!meeus/[email protected]/wave/reader.go:145 +0x143
github.com/DylanMeeus/GoAudio/wave.ReadWaveFile(0x10d7ea8, 0x13, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)

I imagine the omission is due to there being no math constant defined for a max 24bit integer, which is understandable. It looks like other packages work around this by simply defining their own -- either by defining it as 8bitmax+16bitmax, or, in the case of mysql:

const (
	MaxUint24 = 1<<24 - 1
	MaxInt24  = 1<<23 - 1
	MinInt24  = -1 << 23
)

I'm happy to drop a PR if it'd be helpful, but I figured I'd just give you a heads up first, as I'm not 100% sure that my solution is correct

Cheers,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.