This file contains 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
import numpy as np | |
from numpy import random | |
import scipy.fftpack | |
import matplotlib.pyplot as plt | |
def white_noise(length, f_s=44100): | |
sample = length * f_s | |
time_step = 1. / f_s | |
time_arr = np.arange(sample) * time_step | |
noise = random.randn(time_arr.size) |
This file contains 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
import sys | |
import scipy.fftpack | |
import scipy.io.wavfile | |
import numpy as np | |
import matplotlib.pyplot as plt | |
if __name__ == "__main__": | |
wav_file = sys.argv[1] | |
f_s, x = scipy.io.wavfile.read(wav_file) |
This file contains 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
import sys | |
import scipy.fftpack | |
import scipy.io.wavfile | |
import numpy as np | |
import matplotlib.pyplot as plt | |
if __name__ == "__main__": | |
wav_file = sys.argv[1] | |
f_s, x = scipy.io.wavfile.read(wav_file) |
This file contains 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
#!/bin/sh | |
file_name=${1:?File name is not set} | |
base_name=`basename ${file_name} .wav` | |
interval=${2:-1} | |
duration=`soxi ${file_name} | awk '/Duration/ {print $3}' | tr ':.' ' '` | |
hour=`echo ${duration} | awk '{print $1}'` | |
minute=`echo ${duration} | awk '{print $2}'` | |
second=`echo ${duration} | awk '{print $3}'` |
This file contains 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
for wav in *.wav; do wav2raw ${wav}; done |
This file contains 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
#!bin/sh | |
file_name=${1:?File name is not set} | |
base_name=`basename ${file_name} .raw` | |
x2x +sf ${file_name} | frame -l 2048 -p 1024 -n | mfcc -l 2048 -f 44.1 > ${base_name}.mfcc |
This file contains 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
for mfcc in ./speech-only/*.mfcc; do bcut +f -s 264 -e 275 ${mfcc} > `basename ${mfcc} .mfcc`.mfcc; done |
This file contains 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
#! /usr/bin/env python | |
import sys | |
import pysptk | |
import numpy as np | |
import scipy.io.wavfile | |
if __name__ == "__main__": | |
wav = sys.argv[1] | |
fs, x = scipy.io.wavfile.read(wav) | |
x = x.astype(np.float64) |
This file contains 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
#! /usr/bin/env python -O | |
# -*- encode: utf-8 -*- | |
import sys | |
import json | |
import requests | |
message_param = sys.argv[1] | |
apikey_param = "plz set your api key" | |
url = "https://chatbot-api.userlocal.jp/api/chat?" |
This file contains 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
a2z = [chr(i) for i in range(97,97+26)]; print("\n".join([dict(sum([list(dic.items()) for dic in [{i: s[:8*2], i+2: s[2*8:]} for i, s in enumerate([" ".join(sorted(a2z[0::4] + a2z[1::4])), " ".join(sorted(a2z[2::4] + a2z[3::4]))])]], []))[i] for i in range(4)])) |
OlderNewer