Skip to content

Commit

Permalink
Updated dependencies (librosa and pydub)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbklim committed Aug 22, 2022
1 parent 1db15fc commit a69dbe8
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 32 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.vscode/
__pycache__/
dist/
env_*/
*.egg-info/
*.wav
Expand Down
Binary file added dist/webrtcvad-wrapper-1.4.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
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:
long_description = f.read()


install_requires = [
'pydub==0.23.1',
'pydub>=0.23.1',
'webrtcvad==2.0.10',
'librosa==0.7.1'
'librosa>=0.7.1'
]


Expand Down
7 changes: 1 addition & 6 deletions test_webrtcvad_wrapper.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
7 changes: 1 addition & 6 deletions webrtcvad_wrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -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 аудиозаписи.
Expand Down
7 changes: 1 addition & 6 deletions webrtcvad_wrapper/cli.py
Original file line number Diff line number Diff line change
@@ -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().
Expand Down
13 changes: 3 additions & 10 deletions webrtcvad_wrapper/webrtcvad_wrapper.py
Original file line number Diff line number Diff line change
@@ -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 аудиозаписи.
Expand All @@ -16,16 +11,14 @@
Зависимости: pydub, librosa, webrtcvad.
'''

import os
import sys
import collections
from pydub import AudioSegment
import webrtcvad
import librosa
import numpy as np


__version__ = 1.1
__version__ = 1.4


class Frame(object):
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit a69dbe8

Please sign in to comment.