Skip to main content

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

Project description

Install Ubuntu Packages

sudo apt update
sudo apt install ffmpeg
apt-get install wget

Using Example

  1. Audio Downsample
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)
  1. Audio Trimming
from AudioPlaza.trim 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)
  1. Download Audio from Google Drive
from AudioPlaza.googledrive import gdown
fid = ""
fname = ""

gdown(fid, fname)
  1. Get Audio Duration Statistics
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.0.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

AudioPlaza-0.0.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

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