【语音识别入门】My-Voice-Analysis
简介
My-Voice-Analysis 是一个用于分析语音(同时语音、高熵)的 Python 库,打破话语并检测音节边界、基频轮廓和共振峰。其内置功能:
- 性别区分
- 语气分析
- 发音得分
- 发音率
- 语速
- 填充
- f0 统计
一、安装
my-voice-analysis 可以像任何其他 Python 库一样安装,Python 包管理器 pip(最新版本):
pip install my-voice-analysis
如果不成功,可以试试下面这个
pip install myprosody
二、示例用法
音频文件必须为*.wav格式,以44kHz采样帧和16位分辨率录制
1、性别区分函数 myspgen(p,c)
//_init_.py
def myspgend(m,p):sound=p+"/"+m+".wav"sourcerun=p+"/myspsolution.praat" path=p+"/"try:objects= run_file(sourcerun, -20, 2, 0.3, "yes",sound,path, 80, 400, 0.01, capture_output=True)print (objects[0]) # This will print the info from the sound object, and objects[0] is a parselmouth.Sound objectz1=str( objects[1]) # This will print the info from the textgrid object, and objects[1] is a parselmouth.Data object with a TextGrid insidez2=z1.strip().split()z3=float(z2[8]) # will be the integer number 10z4=float(z2[7]) # will be the floating point number 8.3if z4<=114:g=101j=3.4elif z4>114 and z4<=135:g=128j=4.35elif z4>135 and z4<=163:g=142j=4.85elif z4>163 and z4<=197:g=182j=2.7elif z4>197 and z4<=226:g=213j=4.5elif z4>226:g=239j=5.3else:print("Voice not recognized")exit()def teset(a,b,c,d):d1=np.random.wald(a, 1, 1000)d2=np.random.wald(b,1,1000)d3=ks_2samp(d1, d2)c1=np.random.normal(a,c,1000)c2=np.random.normal(b,d,1000)c3=ttest_ind(c1,c2)y=([d3[0],d3[1],abs(c3[0]),c3[1]])return ynn=0mm=teset(g,j,z4,z3)while (mm[3]>0.05 and mm[0]>0.04 or nn<5):mm=teset(g,j,z4,z3)nn=nn+1nnn=nnif mm[3]<=0.09:mmm=mm[3]else:mmm=0.35if z4>97 and z4<=114:print("a Male, mood of speech: Showing no emotion, normal, p-value/sample size= :%.2f" % (mmm), (nnn))elif z4>114 and z4<=135:print("a Male, mood of speech: Reading, p-value/sample size= :%.2f" % (mmm), (nnn))elif z4>135 and z4<=163:print("a Male, mood of speech: speaking passionately, p-value/sample size= :%.2f" % (mmm), (nnn))elif z4>163 and z4<=197:print("a female, mood of speech: Showing no emotion, normal, p-value/sample size= :%.2f" % (mmm), (nnn))elif z4>197 and z4<=226:print("a female, mood of speech: Reading, p-value/sample size= :%.2f" % (mmm), (nnn))elif z4>226 and z4<=245:print("a female, mood of speech: speaking passionately, p-value/sample size= :%.2f" % (mmm), (nnn))else:print("Voice not recognized")except:print ("Try again the sound of the audio was not clear")
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspgend(p,c)[out] a female, mood of speech: Reading, p-value/sample size= :0.00 5
2、发音后验概率得分百分比:函数 mysppron(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.mysppron(p,c)[out] Pronunciation_posteriori_probability_score_percentage= :85.00
3、检测并计算音节数:函数 myspsyl(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspsyl(p,c)[out] number_ of_syllables= 154
4、检测和计算填充和暂停的数量:函数 mysppaus(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.mysppaus(p,c)[out] number_of_pauses= 22
5、测量语速(速度):函数 myspsr(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspsr(p,c)[out] rate_of_speech= 3 # syllables/sec original duration
6、测量发音(速度):函数 myspatc(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspatc(p,c)[out] articulation_rate= 5 # syllables/sec speaking duration
7、测量说话时间(不包括填充词和暂停):函数 myspst(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspst(p,c)[out] speaking_duration= 31.6 # sec only speaking duration without pauses
8、测量总说话时长(包括填充词和停顿):函数 myspod(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspod(p,c)[out] original_duration= 49.2 # sec total speaking duration with pauses
9、测量说话时长与总说话时长之间的比率:函数 myspbala(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspbala(p,c)[out] balance= 0.6 # ratio (speaking duration)/(original duration)
10、测量基频分布均值:函数 myspf0mean(p,c)
[in] import myspsolution as myspp="Walkers" # Audio File titlec=r"C:\Users\Shahab\Desktop\Mysp" # Path to the Audio_File directory (Python 3.7)mysp.myspf0mean(p,c)[out] f0_mean= 212.45 # Hz global mean of fundamental frequency distribution
三、发展
My-Voice-Analysis 由日本的 Sab-AI Lab(以前称为 Mysolution)开发。它是 Sab-AI 实验室开发语言学声学模型项目的一部分。计划通过添加更高级的功能以及添加语言模型来丰富 My-Voice Analysis 的功能。
请参阅 Myprosody https://github.com/Shahabks/myprosody和 Speech- Rater https://shahabks.github.io/Speech-Rater/)
【语音识别入门】My-Voice-Analysis相关推荐
- TensorFlow发布语音识别入门教程,附1GB数据集代码
原标题:TensorFlow发布语音识别入门教程,附1GB数据集&代码 机械鸡的鸡友经常问:如何开始入门深度学习语音和其他音频识别,例如关键字检测或语音命令. 虽然有一些伟大的开源语音识别系统 ...
- 语音识别入门 --各个模型的整理
语音识别入门 前期知识储备 结构图 语音特征提取 各个模型的尝试 ASRT DeepSpeechRecognition end2end_chinese_speech_recognition Wenet ...
- 语音识别入门第二节:语音信号处理及特征提取
目录 数字信号处理基础 基础知识 傅里叶分析 常用特征提取 特征提取流程 Fbank MFCC 数字信号处理基础 基础知识 模拟信号到数字信号转化(ADC):在科学和工程中,遇到的大多数信号都是连续的 ...
- 语音识别入门第一节:语音识别概述
目录 语音识别的定义 语音识别的重要性 语音交互 语音识别的挑战性 语音识别的发展历史 语音识别的深度学习时代 现代语音识别框架 语料库与工具包 语音识别的定义 语音识别:Automatic Spee ...
- 最白话的语音识别入门—GMM模型
最白话的语音识别入门-GMM模型-2021-01-04 前言 一.高斯混合模型? 二.训练思路 问题1.我要用多少个高斯分布去建立高斯混合模型呢? 问题2.每一个高斯分布在一个GMM中占据了多少分量? ...
- 语音识别入门:从菜鸟到大佬
在人工智能飞速发展的今天,语音识别技术成为很多设备的标配,比如我们会对着手机说"siri,帮我打电话给老板",又或是"小度小度,放首歌"等等. 尽管语音技术在逐 ...
- 《正版 图解语音识别 语音识别入门实践教程 语音识别技术书 人工智能机器学习深度学习计算机网络编程书籍R3Z978》[日]荒木雅弘著【摘要 书评 在线阅读】-苏宁易购图书...
商品参数 图解语音识别 定价 59.00 出版社 人民邮电出版社 版次 1 出版时间 2020年04月 开本 32开 作者 [日]荒木雅弘 装帧 平装-胶订 页数 字数 ISBN编码 97871155 ...
- 语音识别入门课——week5(GMM-HMM)
1.背景知识回顾 1.1特征提取 数字信号的基本知识 MFCC/Fbank特征 1.2混合高斯模型GMM GMM模型 EM算法 1.3隐马尔科夫模型 HMM的三个基本问题(概率问题,预测问题,学习问题 ...
- asr语音识别入门材料
没有语音识别的背景,单看kaldi的代码是看不懂的,去kaldi的新手qq群里面问也没人会教的.好在国外还有2门课程可以自学, 1.英国爱丁堡大学的语音识别课程 http://www.inf.ed.a ...
最新文章
- 一则android软件开发工程师的招聘信息
- Net平台下的分布式缓存设计
- boost::hana::compose用法的测试程序
- Maven and Nexus2
- 【ArcGIS风暴】ArcGIS中等高线高程标注/注记(打断/消隐)方法案例汇总
- 当退出python时是否释放全部内存_python 关于高级特性的问题
- Spring5+CXF整合开发REST之一次坑旅
- Tplink客户端设置
- 一题多解 —— linux 日志文件(log)reload 重新载入
- python画50个图-Matplotlib如何绘制多个子图
- java 从一个容器获取对象,Java 如何实现从spring容器中获取注入的bean对象
- Android IntentService的使用和源代码分析
- 基本办公软件的使用及技巧:便签篇
- IPTABLES中SNAT和MASQUERADE的区别
- 移动热点服务的属性此计算机,Win10打开移动热点的四种方法
- 安卓苹果下载地址合并 苹果安卓专用二维码是如何生成的
- 机器学习实战(Machine Learning in Action)参考答案以及原始数据
- windows服务器安全设置怎样操作,要注意什么?
- Xposed 反检测
- php和mysql不在一台机器上_MySQL_在同一台机器上运行多个 MySQL 服务,**************************************** - phpStudy...