diff --git a/.gitignore b/.gitignore index 5baf9fb..9768773 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ .vscode/ __pycache__/ -dist/ env_*/ *.egg-info/ *.wav diff --git a/dist/webrtcvad-wrapper-1.4.tar.gz b/dist/webrtcvad-wrapper-1.4.tar.gz new file mode 100644 index 0000000..56cd5e5 Binary files /dev/null and b/dist/webrtcvad-wrapper-1.4.tar.gz differ diff --git a/setup.py b/setup.py index 6cf5e00..c4148f2 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from setuptools import setup, find_packages -__version__ = 1.3 +__version__ = 1.4 with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), 'README.md'), encoding='utf-8') as f: @@ -19,9 +19,9 @@ install_requires = [ - 'pydub==0.23.1', + 'pydub>=0.23.1', 'webrtcvad==2.0.10', - 'librosa==0.7.1' + 'librosa>=0.7.1' ] diff --git a/test_webrtcvad_wrapper.py b/test_webrtcvad_wrapper.py index a4ba890..60b2df6 100644 --- a/test_webrtcvad_wrapper.py +++ b/test_webrtcvad_wrapper.py @@ -1,11 +1,6 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# OS : GNU/Linux Ubuntu 16.04 or 18.04 -# LANGUAGE : Python 3.5.2 or later -# AUTHOR : Klim V. O. -# DATE : 14.10.2019 -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# OS: GNU/Linux, Author: Klim V. O. ''' Тесты для WebRTCVAD_Wrapper. diff --git a/webrtcvad_wrapper/__init__.py b/webrtcvad_wrapper/__init__.py index 2997c9a..048bb79 100644 --- a/webrtcvad_wrapper/__init__.py +++ b/webrtcvad_wrapper/__init__.py @@ -1,11 +1,6 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# OS : GNU/Linux Ubuntu 16.04 or 18.04 -# LANGUAGE : Python 3.5.2 or later -# AUTHOR : Klim V. O. -# DATE : 14.10.2019 -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# OS: GNU/Linux, Author: Klim V. O. ''' Предназначен для удаления тишины/извлечения фрагментов с речью (или другими звуками) из wav аудиозаписи. diff --git a/webrtcvad_wrapper/cli.py b/webrtcvad_wrapper/cli.py index f0b706e..7c81942 100644 --- a/webrtcvad_wrapper/cli.py +++ b/webrtcvad_wrapper/cli.py @@ -1,11 +1,6 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# OS : GNU/Linux Ubuntu 16.04 or 18.04 -# LANGUAGE : Python 3.5.2 or later -# AUTHOR : Klim V. O. -# DATE : 14.10.2019 -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# OS: GNU/Linux, Author: Klim V. O. ''' Интерфейс командной строки для webrtcvad_wrapper.VAD(). diff --git a/webrtcvad_wrapper/webrtcvad_wrapper.py b/webrtcvad_wrapper/webrtcvad_wrapper.py index 245476e..bee0044 100644 --- a/webrtcvad_wrapper/webrtcvad_wrapper.py +++ b/webrtcvad_wrapper/webrtcvad_wrapper.py @@ -1,11 +1,6 @@ #!/usr/bin/python3 # -*- coding: utf-8 -*- -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# OS : GNU/Linux Ubuntu 16.04 or 18.04 -# LANGUAGE : Python 3.5.2 or later -# AUTHOR : Klim V. O. -# DATE : 14.10.2019 -# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# OS: GNU/Linux, Author: Klim V. O. ''' Предназначен для удаления тишины/извлечения фрагментов с речью (или другими звуками) из wav аудиозаписи. @@ -16,8 +11,6 @@ Зависимости: pydub, librosa, webrtcvad. ''' -import os -import sys import collections from pydub import AudioSegment import webrtcvad @@ -25,7 +18,7 @@ import numpy as np -__version__ = 1.1 +__version__ = 1.4 class Frame(object): @@ -166,7 +159,7 @@ def rough_filter(self, audio, frame_duration_ms=10, sample_rate=None, threshold_ frame_shift = int(frame_duration_ms / 2 * sample_rate / 1000) # Вычисление RMS (отражает мощность звуковой волны) - rms = librosa.feature.rms(audio_data, frame_length=frame_len, hop_length=frame_shift) + rms = librosa.feature.rms(y=audio_data, frame_length=frame_len, hop_length=frame_shift) rms = rms[0] rms = librosa.util.normalize(rms, axis=0)