📄 rec_play.py
字号:
## records an AIFF sample and plays it# infinity number of times.#import timeimport aldef recordit () : p = al.openport('hello', 'r') print 'recording...' buf = p.readsamps(500000) print 'done.' p.closeport() return bufdef playit (buf) : p = al.openport('hello', 'w') print 'playing...' p.writesamps(buf) while p.getfilled() > 0: time.sleep(0.01) print 'done.' p.closeport()while 1 : playit (recordit ())
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -