当前位置:网站首页>Speech feature extraction of emo-db dataset
Speech feature extraction of emo-db dataset
2022-04-22 04:48:00 【Serious classmate Cao】
EMO-DB Data sets Speech feature extraction
Data set introduction
- EMO-DB The data set is a German emotional speech database recorded by the Berlin Institute of Technology
- 535 Audio file ( There are ten actors, five men and five women ) The content of the sentence contains the words of daily life 5 A short sentence and 5 A long sentence , Have a high degree of emotional freedom , Does not contain a particular emotional tendency . use 16kHZ sampling ,16bit quantitative , And WAV Format save file .
- Which is composed of emotions :anger, neutral, fear, boredom, happiness, sadness, disgust.

It mainly uses this voice tag audio Of documents XXXWa.wav in W It's emotion

Extract relevant features
import feature
import os
import pickle
import tqdm
def extract_emodb(file_name:str):
label = file_name.split('.')[0][-2]
feature_27 = feature.extract_mfcc_feature(file_name)
return (label,feature_27)
database_dir = "H:\dataset\EM-DB\wav"
feature_tuple =()
dir_file = os.listdir(database_dir)
for i in tqdm.tqdm(dir_file):
file_path = os.path.join(database_dir,i)
feature_tuple = feature_tuple+ (extract_emodb(file_path),)
with open('emo_db.pkl', 'wb+') as file:
pickle.dump(feature_tuple,file)
Tools
def read_file(filename):
""" input a filename and get wave data and time,framerate :param filename: :return: """
file = wave.open(filename, 'r')
params = file.getparams()
nchannels, sampwidth, framerate, wav_length = params[:4]
str_data = file.readframes(wav_length)
wavedata = np.fromstring(str_data, dtype=np.short)
time = np.arange(0, wav_length) * (1.0 / framerate)
file.close()
return wavedata, time, framerate
def extract_mfcc_feature(filename):
""" input a filename extract mfcc from audio :param filename: :return: """
data, time, rate = read_file(filename)
mel_spec = ps.logfbank(data, rate, nfilt=13)
np.set_printoptions()
time = mel_spec.shape[0]
if time <= 300:
part = mel_spec
part = np.pad(part, ((0, 300 - part.shape[0]), (0, 0)), 'constant',
constant_values=0)
mfcc = dct(part)
else:
begin = 0
end = 300
part = mel_spec[begin:end, :]
mfcc = dct(part)
return mfcc
summary
This data set is still relatively simple , clear , I cannot understand you .
版权声明
本文为[Serious classmate Cao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220447377169.html
边栏推荐
猜你喜欢

【Selenium】Yaml数据驱动

vue项目 npm run build 打包项目时为css、js文件加时间戳版本号,防止浏览器缓存

Linear regression of machine learning

安装opencv时遇到的报错
![[chestnut sugar GIS] ArcMap - how to combine multiple images into one](/img/b4/fb1ceaf4cbb040ae0fc1d0ffbc46f9.png)
[chestnut sugar GIS] ArcMap - how to combine multiple images into one
Apple plans to expand children's information and communication security features to the UK and Canada

2022 P cylinder filling training questions and answers

First knowledge of UI automation (inspect.exe + uiautomation)

Creative geometry point line surface triangle Memphis poster banner advertising design AI vector background material

Calculator (force buckle)
随机推荐
LeetCode 剑指 Offer 65. 不用加减乘除做加法***
2022年山东省安全员C证考试题及在线模拟考试
Deployment of web server, personal experience
LeetCode 剑指 Offer 22. 链表中倒数第k个节点
The simulation generates random numbers and calculates the birthday of each student
How to realize different values and display different colors in MATLAB
JVM - G1 garbage collector
win10卡顿修复
22.4.21学习感悟
Es next related
12.libevent循环函数和退出测试
-bash: /home/lylg/bin/kf. sh: /bin/bash^M: bad interpreter: No such file or directory
Linear regression API
Creative geometry point line surface triangle Memphis poster banner advertising design AI vector background material
Article 1 of linked list
pycharm+anaconda安装包
2022a special equipment related management (elevator) test question simulation test question bank simulation test platform operation
2022g2 boiler operator certificate examination question bank and online simulation examination
jsp hello world中文乱码
2022 question bank and answers of Shandong Province safety officer C certificate special operation certificate examination