Skip to content

Instantly share code, notes, and snippets.

filenames = {'samples/teacher/super.wav','samples/teacher/yume_deem.wav','samples/teacher/yume2005_deem.wav'};
%'samples/panic.wav','samples/super.wav', 'samples/yume.wav','samples/yume2005.wav','samples/single.mp3'
%filenames = {'old/good_rg.wav','old/bad_rg.wav'};
method = 'peri'; % peri, welch, fft, fftband
close all
for i = 1:length(filenames)
file = filenames{i};
[wave,Fs]=audioread(file);
x=(wave(:,1)+wave(:,2))/2; %Downmix
@fireattack
fireattack / normalizerms.m
Created July 1, 2017 22:34
Normalize audio signal via target RMS (in dB)
function [ y ] = normalizerms( x, targetdB )
%NORMALIZERMS Summary of this function goes here
% Detailed explanation goes here
%normalize
targetrms=10^(targetdB/20);
myrms=rms(x);
% valueDBFS = 20*log10(abs(myrms));
y=x/(myrms/targetrms);
end
@fireattack
fireattack / rename_gamecg_pack.py
Created June 26, 2017 02:36
Batch rename CG pack
import re
from os import listdir, rename, makedirs
from os.path import join, splitext, basename, exists
from urllib.parse import quote
from bs4 import BeautifulSoup as bs
from requests import get # to make GET request
def advrename(original_full_path, new_filename, c):
new_full_path = join(pathforrenamed, new_filename)