Skip to content

Instantly share code, notes, and snippets.

@moeseth
moeseth / waveform.py
Created October 12, 2015 08:19
Create Soundcloud style waveform from Audio in Python
from pydub import AudioSegment
from matplotlib import pyplot as plot
from PIL import Image, ImageDraw
import numpy as np
import os
src = "./test.mp3"
audio = AudioSegment.from_file(src)
data = np.fromstring(audio._data, np.int16)
import requests
import time
import telegram_send
import datetime
from collections import defaultdict
telegram_send.send(['Starting bot'])
known_data = defaultdict(list)