This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 波形をモーフィングします | |
# | |
# usage: | |
# python main_stereo.py --input in.wav --image shape.png --output out.wav --lam 0.8 --rho 0.9 --iters 4 --nfft 2048 --hop 512 --target-peak 1.0 --fc-amp 5000 --fc-dc 3000 | |
# Tips: lambdaは0.4–0.8、rhoは高めの値を推奨します | |
# | |
import argparse | |
import math | |
from typing import Tuple, Dict, Optional, Literal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 指定した音声のスペクトログラムに画像を書き込みます | |
# | |
# usage: | |
# pip install numpy scipy librosa soundfile pillow | |
# python draw_spec.py in.wav image.png out.wav --ink_db -20 --guard_hz 100 --n_fft 4096 --hop 1024 | |
# | |
from typing import Optional, Sequence, Tuple, Literal | |
import numpy as np |