Skip to main content

AudioPlaza: RAONDATA speech team's Audio Preprocessing written by python

Project description

## Install Ubuntu Packages

`bash sudo apt update sudo apt install ffmpeg apt-get install wget ` * Pre-install those packages using ubuntu apt

## Install using pip `bash pip install AudioPlaza ` * You can install this from PYPI, pip.

## Using Example

1. Audio Downsample `python from AudioPlaza.downsample import audio_downsample input_path = "./input.wav" # 입력 파일명 out_path = "./out.wav" # 출력 파일명 sample_rate = 22050 # 샘플레이트 (22.05 khz) audio_downsample(input_path, out_path, sr=sample_rate) `

2. Audio Trimming/Padding 1 (Zero, One, Repeat Padding) * 그냥 0, 1, 맨 끝 오디오를 기반으로 패팅 * 너무 길면 트리밍 * 같은 숫자로 하기 때문에 미세한 노이즈가 반영되지 못하는 경우가 존재

`python from AudioPlaza.trim1 import trimmer input_path = "./input.wav" # 입력 파일명 out_path = "./out.wav" # 출력 파일명 sample_rate = 22050 # 샘플레이트 (22.05 khz) padding_sec = 0.3 # 앞 뒤로 패딩을 몇초 줄건지 tr = trimmer(sample_rate=sample_rate, pad="zero") # pad = "zero", "one", "repeat" tr.trim(input_path, out_path, padding_sec=padding_sec) `

3. Audio Trimming 2 (Noise Sampling) * 노이즈(말이 아닌 부분)을 샘플링하여 만들고, 이를 패딩에 활용해주는 기법. * 말이 뚝 짤리는 등의 문제는 해결할 수 없지만, 0으로 되어 소리가 끊겨 모델의 학습에 부정적 영향을 주는 경우는 방지. `python from AudioPlaza.trim2 import trimmer input_path = "./input.wav" # 입력 파일명 out_path = "./out.wav" # 출력 파일명 sample_rate = 22050 # 샘플레이트 (22.05 khz) padding_sec = 0.3 # 앞 뒤로 패딩을 몇초 줄건지 tr = trimmer(sample_rate=sample_rate, dict_size=50) # dict_size => 노이즈 딕셔너리의 사이즈 / 너무 크지 않게 주의 (50 기본값) tr.trim(input_path, out_path, padding_sec=padding_sec) `

4. Download Audio from Google Drive `python from AudioPlaza.googledrive import gdown fid = "" fname = "" gdown(fid, fname) `

5. Get Audio Duration Statistics `python from AudioPlaza.duration import get_duration, get_folder_duration dur = get_duration("./audio.wav") print(dur) # ~~ sec stat = get_folder_duration("./wavs/") print(stat) # 정보 stat.draw_plot("./stat.png") #내용을 plot으로 그려서 시각화 `

## Version Information * 0.0.1: Initial version with trim, downsample, googledrive, duration statistics. (Some features from RAONDIO)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AudioPlaza-0.1.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

AudioPlaza-0.1.2-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file AudioPlaza-0.1.2.tar.gz.

File metadata

  • Download URL: AudioPlaza-0.1.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for AudioPlaza-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4b080f947ecf4d0f5f951e45deb83c5d04014517952825517c9184663fd0cef5
MD5 c9b56c206afa6c9cf62bcf40b5857d2a
BLAKE2b-256 fe884659f2219747c169e2180a9cf4d64f9b77fae01ef2a2d9babc20009b721c

See more details on using hashes here.

File details

Details for the file AudioPlaza-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: AudioPlaza-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for AudioPlaza-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3a9385241b6a10990242a53ffb71ea250dcc977f3c565ec6042f73a579ff10bc
MD5 3c2343624e6747c6a2a17e5eb86ce0c0
BLAKE2b-256 3e582e43db2299631de6a2cfb27353d10881db56ab24953a1ce447d75d77f245

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page