Skip to content

Commit

Permalink
Create main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Smehnov authored Feb 10, 2024
1 parent 07a23e4 commit 410c6f1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import os

print("Start recording audio")
sample_name = "aaaa.wav"
cmd = f'arecord -vv --format=cd --device={os.environ["AUDIO_INPUT_DEVICE"]} -r 48000 --duration=10 -c 1 {sample_name}'
print(cmd)
os.system(cmd)
print("Playing sound")
os.system(f"ffplay -nodisp -autoexit -loglevel quiet {sample_name}")

# Capture image
import cv2
camera_capture = cv2.VideoCapture(0)
rv, image = camera_capture.read()
print(f"Image Dimensions: {image.shape}")
camera_capture.release()

0 comments on commit 410c6f1

Please sign in to comment.