Skip to content

Instantly share code, notes, and snippets.

View tatakof's full-sized avatar

Tatako Felici tatakof

View GitHub Profile
@korakot
korakot / record.py
Last active August 23, 2024 08:45
Record audio in Colab using getUserMedia({ audio: true })
# all imports
from IPython.display import Javascript
from google.colab import output
from base64 import b64decode
from io import BytesIO
!pip -q install pydub
from pydub import AudioSegment
RECORD = """
const sleep = time => new Promise(resolve => setTimeout(resolve, time))