Skip to content

Instantly share code, notes, and snippets.

@mayok
Created December 24, 2013 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayok/8114886 to your computer and use it in GitHub Desktop.
Save mayok/8114886 to your computer and use it in GitHub Desktop.
なんの進捗もありません を浮かび上がらせるプログラム書いた ネタ元=>https://twitter.com/yuma_koizumi/statuses/411345566124097537
#!/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()
@mayok
Copy link
Author

mayok commented Oct 6, 2014

実行しても,浮かび上がらないし,何か間違っている

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment