tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Record-sound/Python/record-sound.py
Normal file
17
Task/Record-sound/Python/record-sound.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import pyaudio
|
||||
|
||||
chunk = 1024
|
||||
FORMAT = pyaudio.paInt16
|
||||
CHANNELS = 1
|
||||
RATE = 44100
|
||||
|
||||
p = pyaudio.PyAudio()
|
||||
|
||||
stream = p.open(format = FORMAT,
|
||||
channels = CHANNELS,
|
||||
rate = RATE,
|
||||
input = True,
|
||||
frames_per_buffer = chunk)
|
||||
|
||||
data = stream.read(chunk)
|
||||
print [ord(i) for i in data]
|
||||
Loading…
Add table
Add a link
Reference in a new issue