All Projects → Baidu-AIP → Speech Vad Demo

Baidu-AIP / Speech Vad Demo

集成Webrtc的VAD,用于切分音频文件

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Speech Vad Demo

getScreenId
getScreenId | Capture Screen on Any Domain! This script is a hack used to support single chrome extension usage on any HTTPs domain.
Stars: ✭ 59 (-77.22%)
Mutual labels:  webrtc
hifigan-denoiser
HiFi-GAN: High Fidelity Denoising and Dereverberation Based on Speech Deep Features in Adversarial Networks
Stars: ✭ 88 (-66.02%)
Mutual labels:  speech
Amazing Python Scripts
🚀 Curated collection of Amazing Python scripts from Basics to Advance with automation task scripts.
Stars: ✭ 229 (-11.58%)
Mutual labels:  speech
broadcast-sample-app
OpenTok Broadcast Sample Application
Stars: ✭ 48 (-81.47%)
Mutual labels:  webrtc
sbcOS
Barebone Opensource Powered SBC
Stars: ✭ 59 (-77.22%)
Mutual labels:  webrtc
go-ayame
go-ayame is go client library for WebRTC Signaling Server Ayame
Stars: ✭ 20 (-92.28%)
Mutual labels:  webrtc
webrtcsink
All-batteries included GStreamer WebRTC producer
Stars: ✭ 18 (-93.05%)
Mutual labels:  webrtc
Ion Sfu
Pure Go WebRTC SFU
Stars: ✭ 258 (-0.39%)
Mutual labels:  webrtc
rtc-ssh
WebRTC wrapper for SSH connect
Stars: ✭ 95 (-63.32%)
Mutual labels:  webrtc
sora-unity-sdk-samples
WebRTC SFU Sora Unity SDK サンプル集
Stars: ✭ 12 (-95.37%)
Mutual labels:  webrtc
snowem
Snowem is a lightweight live streaming server, based on webrtc technology. Its design mainly focuses on simplicity, scalability and high performance.
Stars: ✭ 73 (-71.81%)
Mutual labels:  webrtc
suc-love-chat
视频会议系统前端源码
Stars: ✭ 35 (-86.49%)
Mutual labels:  webrtc
Noise2Noise-audio denoising without clean training data
Source code for the paper titled "Speech Denoising without Clean Training Data: a Noise2Noise Approach". Paper accepted at the INTERSPEECH 2021 conference. This paper tackles the problem of the heavy dependence of clean speech data required by deep learning based audio denoising methods by showing that it is possible to train deep speech denoisi…
Stars: ✭ 49 (-81.08%)
Mutual labels:  speech
mediasoup-cpp
The full C++ implementation of mediasoup
Stars: ✭ 27 (-89.58%)
Mutual labels:  webrtc
Jazminserver
Java based application,rpc,message,rtmp,game,sip,rtp,relay,webrtc,webssh,proxy server,message queue,mysql proxy server
Stars: ✭ 256 (-1.16%)
Mutual labels:  webrtc
Dockerfiles
Optimized media, analytics and graphics software stack images. Use the dockerfile(s) in your project or as a recipe book for bare metal installation.
Stars: ✭ 98 (-62.16%)
Mutual labels:  webrtc
peermesh
💫 Exchange files p2p and e2e encrypted over a fully meshed network in your browser using WebRTC.
Stars: ✭ 107 (-58.69%)
Mutual labels:  webrtc
Speech Aligner
speech-aligner,是一个从“人声语音”及其“语言文本”,产生音素级别时间对齐标注的工具。speech-aligner, is a tool that generate phoneme-level alignment between human speech and its transcription
Stars: ✭ 259 (+0%)
Mutual labels:  speech
Starrtc Android Demo
🚀starRTC,即时通讯(IM)系统,免费IM系统(含单聊,群聊,聊天室,文件传输),免费一对一视频聊天,VOIP,语音对讲(回音消除),直播连麦,视频直播,RTSP拉流,RTMP推流,webRTC服务端,在线教育,白板,小班课,在线会议,视频会议,视频监控,局域网直连(无需服务器),兼容webRTC, 支持webRTC加速,P2P高清传输,安卓、iOS、web互通,支持门禁对讲,可视对讲,电视盒子,树莓派,海思,全志,任天堂switch,云游戏,OTT设备,物联网平台,C语言自研方案,支持二次开发成类微信,类映客等APP,✨万水千山总是情,来个star行不行✨,更多示例请访问:
Stars: ✭ 3,038 (+1072.97%)
Mutual labels:  webrtc
webrtc-hotwire-rails
A video chat app demonstration using Hotwire and Ruby on Rails
Stars: ✭ 38 (-85.33%)
Mutual labels:  webrtc

speech-vad-demo

简介

简介

项目地址: https://github.com/Baidu-AIP/speech-vad-demo

集成 webrtc 开源项目,vad模块,具体算法GMM(Gaussian Mixture Model)。

由于百度rest api接口有60s的音频时长限制,使用此demo可以粗略地按照静音切分音频。

原理

一个FRAME时长默认10s,通过webrtc的vad计算这个FRAME是否是活动(ACTIVE: 有声音, INACTIVE,静音)。

这样可以获得音频的所有FRAME的活动值(ACTIVE或者INACTIVE)。从而在静音(INACTIVE)的音频段上的切分音频。

运行环境

  • g++ 4.8以上,
  • cmake 2.8 及 make 3.8 编译需要,可以跳过或者尝试使用低版本
  • 任意操作系统

如果没有g++ 4.8的版本,centos可以参考“Linux C++ SDK”的文档,进行g++ 4.8的安装。

由于webrtc项目vad模块依赖于rtc_base模块 进行运行时的参数检查,因此需要可以编译rtc_base的。 如果您无法升级到g++ 4.8 或者是只能编译C项目,可以自行修改源代码,删除rtc_bas目录,及其它文件对rtc_base中宏的依赖,,剩余文件均为C代码。去除后请详细测试。

运行及结果

运行命令

Linux:

# 确认g++ 和cmake 版本
sh build_and_run.sh

# 或
cmake . && make

Windows:

Windows 安装 cygwin,及cygwin 中 下载cmake make gcc g++等编译软件

sh build_and_run.sh

# 或
cmake . && make

结果

如果不修改代码的话,结果保存在 output_pcm 内。 文件名如下

16k_1.pcm_0-12989_A.pcm         // 第0-12989毫秒的音频, 
16k_1.pcm_33730-47389_A.pcm     // 第33730-47389毫秒的音频
16k_1.pcm_0-4049_A.pcm         // A 表示此段有声音,不是完全的静音
···
16k_1.pcm_114060-121689_I.pcm  // I 表示此段都是静音

参数设置

common.h

// MULTI = 1 2 3 webrtc vad可以设置分别为以10ms 20ms 30ms作为包
#define MULTI 1

// VAD 模式 Aggressiveness mode (0, 1, 2, or 3). 数值越大,判断越是粗略,连着的静音或者响声增多
#define WEBRTC_VAD_MODE 3

// 有声音的音频段,xxx 毫秒后,认为该音频段结束,不能为0
#define FILE_CUT_SILENCE_AFTER_ACTIVE_MS 500

// 静音的音频段,切分xxx毫秒给之后有声音的音频段
#define FILE_CUT_SILENCE_BEFORE_ACTIVE_MS 300

// 最小的音频切分长度,即每个切分后音频文件不少于这个时长,最后一个除外
#define FILE_CUT_MIN_MS  (10 * 1000)

// 最大的音频切分长度,即每个切分后音频文件不多于这个时长
#define FILE_CUT_MAX_MS  (60 * 1000)

/** 上述示例中音频文件尽可能依次满足如下条件
1. 最短10s,最长 60s。 
2. 每个音频文件的最后的静音500ms, 
2. 每个音频文件的开始的静300ms。
 */

切割逻辑修改

demo因为考虑到流式,采用了尽快切割的方法。如果您对这个切割算法不满意的话,可以对照periods_print的结果, 自行修改file_cut.c内的代码逻辑

// [5150, 5220) [5230, 6380) [6520, 6970) [7000, 8040) [8080, 8670)
// 表示 [5150, 5220) 等区间内是有声音的,其它区间均为静音,
// 如果需要切割的话,应该在静音区间选择合适的位置切割
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].