一个简单的音频数据扩充包

augaudio的Python项目详细描述


奥格奥迪

该软件包包含多个简单的音频数据增强,以提高/测试神经网络的鲁棒性。在

原件
高斯噪声
音高偏移
时间延伸
压碎

安装

您可以通过 pip install augaudio

使用

用法示例:

importlibrosaimportaugaudioimportsoundfiley,sr=librosa.load('audio.wav')augmented=augaudio.augment(y,1,4)soundfile.write('augmented.wav',augmented,sr)

直接访问其中一个扩充:

^{pr2}$

链扩充在一起:

...augmented=augaudio.GaussianNoise(augaudio.TimeStretch(y,2),4)...

迭代扩充:

...foraugmentationinrange(4):forintensityinrange(1,10):augmented=augaudio.augment(y,augmentation,intensity)soundfile.write(str(augmentation)+'-'+str(intensity)+'.wav',augmented,sr)...

命令行用法:

单个文件:

augaudio /path/to/audio.wav 0 5

完成文件夹:

augaudio /path/to/input 0 5 /path/to/output

扩充

AugmentationindexDescriptionnegative intensity
Augmentations-2Applies /multiple/ random augmentationsavailable
Random-1Applies random augmentationavailable
GaussianNoise0Applies gaussian noise to the audio datan/a
PitchShift1Shifts the pitch of the audio dataavailable
TimeStretch2Stretches the time of the audio datan/a
Crush3Crushes details by applying and reversing a pitch shiftavailable

版权声明

Copyright 2020 Bastian Schwickert

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
JFrame中的Java多线程   java Servlet异常映射   java无法从输出流读取   swing Java带来的小程序GUI问题   java什么原因导致错误“'void'类型此处不允许”以及如何修复它?   Java选择器select(长)与selectNow的区别   java自定义arraylist<mygames>获得不同   java Icepdf注释让页面消失   java反向整数数组   java I在生成同步“无法解析配置的所有依赖项”时遇到此错误:app:debugRuntimeClasspath   多个虚拟机上的java线程访问单个DB实例上的表,有时会导致性能低下和异常   swing更改Java中的默认按钮,使其看起来“更好”   java慢速MQ主题订阅。并行化不能提高性能   java运行Boggle Solver需要一个多小时。我的代码怎么了?   数据库中的java循环与应用程序中的java循环   正则表达式匹配${123…456}并在Java中提取2个数字?   java如何制作我们软件的试用版   Java内存参数计算   从另一个类调用方法时出现java问题