Skip to content

Instantly share code, notes, and snippets.

@thepycoach
Created January 19, 2022 01:51
Show Gist options
  • Select an option

  • Save thepycoach/f034e797ed71c271340a25dfd9983b3b to your computer and use it in GitHub Desktop.

Select an option

Save thepycoach/f034e797ed71c271340a25dfd9983b3b to your computer and use it in GitHub Desktop.
import pyaudio
FRAMES_PER_BUFFER = 3200
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
p = pyaudio.PyAudio()
# starts recording
stream = p.open(
format=FORMAT,
channels=CHANNELS,
rate=RATE,
input=True,
frames_per_buffer=FRAMES_PER_BUFFER
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment