Skip to content

Instantly share code, notes, and snippets.

@pklazy
pklazy / recodrdTest.py
Created May 21, 2014 16:26
만들어진 파일은 'aplay -r 44100 -f S16_LE -c 1 test.raw'로 재생.
import time
import alsaaudio
f = open('test.raw', 'wb')
card = alsaaudio.cards()[1]
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NONBLOCK, card)
inp.setchannels(1)
inp.setrate(44100)
inp.setformat(alsaaudio.PCM_FORMAT_S16_LE)
inp.setperiodsize(160)
@pklazy
pklazy / nsx-39_test.py
Last active August 29, 2015 14:01
NSX-39 테스트
# coding=utf-8
import pygame.midi as pm
import time
if __name__ == '__main__':
pm.init()
mo = None
mi = None
for i in range(pm.get_count()):