一个简单的音频数据扩充包
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
扩充
Augmentation | index | Description | negative intensity |
---|---|---|---|
Augmentations | -2 | Applies /multiple/ random augmentations | available |
Random | -1 | Applies random augmentation | available |
GaussianNoise | 0 | Applies gaussian noise to the audio data | n/a |
PitchShift | 1 | Shifts the pitch of the audio data | available |
TimeStretch | 2 | Stretches the time of the audio data | n/a |
Crush | 3 | Crushes details by applying and reversing a pitch shift | available |
版权声明
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.
- 项目
标签: