Git Product home page Git Product logo

listener's Introduction

树莓派谛听记录器: 用于家里有女人,且经常说话不认帐时做对证用,其它用途可根据天猫精灵智能音箱的能力自行扩展. 此功能属于智能音箱的旁门左道,如果数据的隐私能得到保证,相信是受到欢迎的,但如果此功能做成商业化,那数据隐私性就很难保证了.即使是家人,相信谁也不愿意自己说的话让别人知道,软件装上后,自己使用,自己知道就够了. 如果想随时方便调取录音记录的文字及声音, 可以在树莓派上安装owncloud私有云盘,将录音数据的目录配置成云数据共享即可,一般的智能手机就可以随时调出数据.

简介: 语音采集器,监听树莓派周围3-5米的人说话,如果检测到有人说话就开始监听声音,直到检测到说话停止. 最后调用百度服务识别出声音的文字信息并记录.最多记录最近5句(可调)识别过有人说过话的原生wav录音.此功能涉及到声音隐私,可能在某些国家中使用是非法的. 代码是写着玩的,供练习用.代码在树莓派3B稳定运行半年以上无故障, 因为效果好,树莓派一直没关机 代码参考了 叮当——中文语音对话机器人里的代码,表示感谢 https://github.com/dingdang-robot/dingdang-robot

算法原理: 1.20秒声音队列,每1秒录一个声音片断,追加到先进先出的队列,无限循环 2.当识别到声音大于某个阀值时,记录下队列的索引位置,同时进入监听模式 3.监听模式下,如果连续两秒声音出现静音,或识别时间>10秒,则结束. 4.把索引位置到当前时间点的录音数据取出来,提交给百度进行识别, 此处的要点是:索引位置减2, 也就是多获取声音阀值前2秒的声音数据,而不是阀值开始的位置 5.如果识别到文字,则记录到log日志中, 同时将wav原始声音文件也放入循环目录备份(循环5个队列)

运行环境: 树莓派3B raspberrypi
树莓派zero使用1-2天会发生采集录音数据异常,内存耗尽,进程被kill问题,可能是因为zero内存只有512M 已在3B上不关机连续运行半年,均正常.

配置: 1.使用时需要修改 baidu_sound_rec.py 里面的这二个变量: api_key = "@@@@@@@@@@@@@@" api_secert = "@@@@@@@@@@@@@@"

2.采集到的声音内容存在放 /myram/snowboy.log 为减少文件经常读写损坏tf卡, 在/etc/rc.local时增加了如下语句将内存虚拟了10M成硬盘使用: sudo mount -t tmpfs -o size=10m,mode=0777 tmpfs /myram

运行: python listener.py

listener's People

Contributors

lixy123 avatar

Watchers

James Cloos avatar

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.