最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

python 声音指纹识别,Python

互联网 admin 34浏览 0评论

python 声音指纹识别,Python

我在试着让Dejavu来处理覆盆子(覆盆子皮3)。我正在尝试将麦克风输入的音频与mysql数据库中的文件进行匹配。我已经测试过,可以用pyaudio录制,但是我需要设置sample rate=24000&CHUNK=4056。我几乎使用了Dejavu示例附带的默认代码。在

当我运行代码时,我得到以下错误:IOError:[Errno Invalid sample rate]-9997

有人对如何解决这个问题有什么建议吗?在

下面是我的Python代码:import warnings

import json

warnings.filterwarnings("ignore")

from dejavu import Dejavu

from dejavu.recognize import FileRecognizer, MicrophoneRecognizer

# load config from a JSON file (or anything outputting a python dictionary)

with open("dejavuf.SAMPLE") as f:

config = json.load(f)

if __name__ == '__main__':

# create a Dejavu instance

djv = Dejavu(config)

# Or recognize audio from your microphone for `secs` seconds

secs = 5

song = djv.recognize(MicrophoneRecognizer, seconds=secs)

if song is None:

print "Nothing recognized -- did you play the song out loud so your mic could hear it? :)"

else:

print "From mic with %d seconds we recognized: %s\n" % (secs, song)

以下是来自终端的日志:

^{pr2}$

python 声音指纹识别,Python

我在试着让Dejavu来处理覆盆子(覆盆子皮3)。我正在尝试将麦克风输入的音频与mysql数据库中的文件进行匹配。我已经测试过,可以用pyaudio录制,但是我需要设置sample rate=24000&CHUNK=4056。我几乎使用了Dejavu示例附带的默认代码。在

当我运行代码时,我得到以下错误:IOError:[Errno Invalid sample rate]-9997

有人对如何解决这个问题有什么建议吗?在

下面是我的Python代码:import warnings

import json

warnings.filterwarnings("ignore")

from dejavu import Dejavu

from dejavu.recognize import FileRecognizer, MicrophoneRecognizer

# load config from a JSON file (or anything outputting a python dictionary)

with open("dejavuf.SAMPLE") as f:

config = json.load(f)

if __name__ == '__main__':

# create a Dejavu instance

djv = Dejavu(config)

# Or recognize audio from your microphone for `secs` seconds

secs = 5

song = djv.recognize(MicrophoneRecognizer, seconds=secs)

if song is None:

print "Nothing recognized -- did you play the song out loud so your mic could hear it? :)"

else:

print "From mic with %d seconds we recognized: %s\n" % (secs, song)

以下是来自终端的日志:

^{pr2}$

发布评论

评论列表 (0)

  1. 暂无评论