Skip to content

Instantly share code, notes, and snippets.

@progyadeep
progyadeep / sound_recorder.py
Created September 3, 2018 10:41 — forked from mabdrabo/sound_recorder.py
Simple script to record sound from the microphone, dependencies: easy_install pyaudio
import pyaudio
import wave
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
CHUNK = 1024
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "file.wav"
@progyadeep
progyadeep / color_conversion.py
Created May 26, 2018 12:38 — forked from mathebox/color_conversion.py
Python methods to convert colors between RGB, HSV and HSL
import math
def rgb_to_hsv(r, g, b):
r = float(r)
g = float(g)
b = float(b)
high = max(r, g, b)
low = min(r, g, b)
h, s, v = high, high, high