mirror of
https://github.com/correl/dejavu.git
synced 2024-11-23 19:19:53 +00:00
22 lines
No EOL
624 B
Python
Executable file
22 lines
No EOL
624 B
Python
Executable file
from dejavu import Dejavu
|
|
from ConfigParser import ConfigParser
|
|
import warnings
|
|
warnings.filterwarnings("ignore")
|
|
|
|
# load config
|
|
config = ConfigParser()
|
|
config.read("dejavu.cnf")
|
|
|
|
# create Dejavu object
|
|
dejavu = Dejavu(config)
|
|
dejavu.fingerprint("va_us_top_40/mp3", "va_us_top_40/wav", [".mp3"], 5)
|
|
|
|
# recognize microphone audio
|
|
from dejavu.recognize import Recognizer
|
|
recognizer = Recognizer(dejavu.fingerprinter, config)
|
|
|
|
song = recognizer.read("va_us_top_40/wav/17_-_#Beautiful_-_Mariah_Carey_ft.wav")
|
|
|
|
# recognize song playing over microphone for 10 seconds
|
|
#song = recognizer.listen(seconds=1, verbose=True)
|
|
#print song |