Skip to content

Instantly share code, notes, and snippets.

View arnaldorusso's full-sized avatar

Arnaldo Russo arnaldorusso

View GitHub Profile
@arnaldorusso
arnaldorusso / Generate WAV from MIDI.md
Last active January 22, 2016 17:02 — forked from jiaaro/Generate WAV from MIDI.md
Generate a wave file from a MIDI file with Pydub

Simple example of rendering a midi file with Pydub

Basically, this takes a MIDI input file (I just googled and grabbed one of Maroon 5's "Animal" – I know, I know) and generates a WAV file.

NOTE: This is the slowest midi rendering program I have ever seen!

Dependencies:

@arnaldorusso
arnaldorusso / midi2mp3
Created January 24, 2016 13:45 — forked from kroger/midi2mp3
Convert MIDI files to MP3 using fluidsynth. See
#!/usr/bin/env bash
SOUNDFONT=/Users/kroger/Dropbox/Sfonts/BOPLMEVF16.sf2
TMPDIR=/tmp
if [[ ! -f $SOUNDFONT ]]
then
echo "Couldn't find the soundfont: $SOUNDFONT"
exit 1
@arnaldorusso
arnaldorusso / speech2text.py
Created August 19, 2017 21:06 — forked from baali/speech2text.py
A Python script to break audio into chunks of smaller audios and using Google API to get Speech to Text.
'''
A hack based on this http://mikepultz.com/2011/03/accessing-google-speech-api-chrome-11/. While with smaller voice samples google speech to text works really good, as length increases quality decreases. So here using audiolab and numPy we are breaking audio sample, in smaller chunks, and removing blank/empty spaces from audio signal and then pushing them to google for processing.
It takes wav file format as input but can be changed to other formats too.
'''
from scikits.audiolab import wavread, play, flacwrite
from numpy import average, array, hstack
import os
import sys