http://stove99.tistory.com/93
http://www.freezner.com/archives/270
http://api.jquery.com/live/
행 추가 삭제 코드
|
작업하는데 있어 필요한 자료들 올라옵니다.
행 추가 삭제 코드
|
| It's not working now. |
코드
|
사용하는 table 양식
|
SyntaxHighlighter 설정 소스를 첨가
|
코드 첨부할때 사용할 태그
... |
예제
|
결과
안녕하세요. 푸른개미 블로그입니다. |
제목을 입력하세요.
|
|
import mp3play
filename = r'C:\Users\Public\Music\Sample Music\Kalimba.mp3'
clip = mp3play.load(filename)
clip.play()
import time
time.sleep(min(30, clip.seconds()))
clip.stop()
|
|
import math
import wave
import struct
import scipy
import numpy as np
import matplotlib.pyplot as plt
freq = 1000.0
data_size = 20*44100
fname = "ChirpWave.wav"
frate = 44100.0
amp = 64000.0 # multiplier for amplitude
t = np.arange(0, data_size/frate, 1/frate)
y= scipy.signal.chirp(t, f0=10, f1=20000, t1=5, method='linear')
wav_file = wave.open(fname, "w")
nchannels = 1
sampwidth = 2
framerate = int(frate)
nframes = data_size
comptype = "NONE"
compname = "not compressed"
wav_file.setparams((nchannels, sampwidth, framerate, nframes,
comptype, compname))
for s in y:
# write the audio frames to file
wav_file.writeframes(struct.pack('h', int(s*amp/2)))
wav_file.close()
|
import wave
import struct
import numpy as np
import matplotlib.pyplot as plt
N = 20 #FIR filter length
fname = ".\WaveTest.wav"
wav_file = wave.open(fname, "r")
framerate = float(wav_file.getframerate())
nframes = wav_file.getnframes()
time = np.arange(0, nframes/framerate, 1/framerate)
x = []
for i in range(nframes):
waveData = wav_file.readframes(1)
x.append(struct.unpack("
wav_file.close()
b = [1.0/N]*N #FIR filter coefficient, moving averaging filter
#Filtering mechanism
#y[n] = b[0]*x[n] + b[1]*x[n-1] + b[2]*x[n-2] + ... + b[n-1]*x[1] + b[n]*x[0]
''' y = [0.0]*nframes for index in range(nframes): for k in range(N): if index-k >= 0: y[index] = y[index] + b[k]*x[index-k] ''' y = np.convolve(b, x, "full")
plt.plot(time, x, time, y)
plt.xlabel("times[s]")
plt.ylabel("data")
plt.xlim(0, 0.005)
plt.show()
|
import math
import wave
import struct
freq = 1000.0
data_size = 40000*4
fname = "WaveTest.wav"
frate = 44100.0
amp = 64000.0 # multiplier for amplitude
sine_list_x = []
for x in range(data_size):
sine_list_x.append(math.sin(2*math.pi*freq*(x/frate)))
wav_file = wave.open(fname, "w")
nchannels = 1
sampwidth = 2
framerate = int(frate)
nframes = data_size
comptype = "NONE"
compname = "not compressed"
wav_file.setparams((nchannels, sampwidth, framerate, nframes,
comptype, compname))
for s in sine_list_x:
# write the audio frames to file
wav_file.writeframes(struct.pack('h', int(s*amp/2)))
wav_file.close()
import os
os.startfile(fname)
|
import wave
import struct
import numpy as np
import matplotlib.pyplot as plt
fname = ".\WaveTest.wav"
wav_file = wave.open(fname, "r")
framerate = float(wav_file.getframerate())
nframes = wav_file.getnframes()
time = np.arange(0, nframes/framerate, 1/framerate)
data = []
for i in range(0,nframes):
waveData = wav_file.readframes(1)
data.append(struct.unpack("
wav_file.close()
plt.plot(time, data)
plt.xlabel("times[s]")
plt.ylabel("data")
plt.xlim(0, 0.01)
plt.show()
|