Skip to content

Instantly share code, notes, and snippets.

@Dutcho
Dutcho / Audio Recorder.py
Created December 26, 2015 14:30 — forked from omz/Audio Recorder.py
Audio Recorder.py
# Retrieved from https://gist.githubusercontent.com/omz/9882a00abf59c6009fa4/raw/139afad596c6d46f2f104b16120eefbb36e9960c/Audio%2520Recorder.py on Sat 26-Dec-2015 07:22:53
# Olaf, 26 Dec 2015, updated to use objc_util instead of ctypes; also removed seemingly superfluous AVAudioSession
import objc_util, os
def main():
NSMutableDictionary = objc_util.ObjCClass('NSMutableDictionary')
settings = NSMutableDictionary.dictionary()
kAudioFormatMPEG4AAC = 1633772320
settings.setObject_forKey_(kAudioFormatMPEG4AAC, 'AVFormatIDKey')
# 2014-08-18 New from Gist.py downloaded from https://gist.github.com/dhutchison/8528503
# 2014-08-18 added generation of header with date, name, download url
### Based on: https://gist.github.com/b0644f5ed1d94bd32805
### This version strips unicode characters from the downloaded script
### to work around the currently limited unicode support of the editor
### module.
# This script downloads and opens a Gist from a URL in the clipboard.
# It's meant to be put in the editor's actions menu.