Created
December 24, 2013 15:41
-
-
Save mayok/8114886 to your computer and use it in GitHub Desktop.
なんの進捗もありません を浮かび上がらせるプログラム書いた ネタ元=>https://twitter.com/yuma_koizumi/statuses/411345566124097537
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 wave | |
import sys | |
import scipy as sp | |
import matplotlib.pyplot as plt | |
import math | |
chunk= 81920 | |
if len(sys.argv) < 2: | |
print ("Plays a wave file. \n\nUsage: %s filename.wav" % sys.argv[0]) | |
sys.exit(-1) | |
wf = wave.open(sys.argv[1], 'rb') | |
data = wf.readframes(chunk) | |
ary = sp.fromstring(data, sp.int16) | |
sampling = 44.1e3 | |
nFFT = 1024 | |
window = sp.hamming(nFFT) | |
Pxx, freqs, bins, im = plt.specgram(ary, | |
NFFT=nFFT,Fs=44100, | |
noverlap=900,window=window) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
実行しても,浮かび上がらないし,何か間違っている