Posts

Showing posts with the label Programming

Convert a wav file to mp3 with FFmpeg, pydub, and three lines of Python

Ten minutes ago I played a song I had not heard before and said, that was a good song! I should send it to Sam. But it's in WAV format so it's really big. Wouldn't it be nice if Python could convert it to mp3 to make it smaller? Ten minutes later it was done. Amazing. Here are the easy steps to follow if you would like to try it. 1. Search the internet for 'python convert wav mp3'. 2. Download FFmpeg and add it to your system path: http://adaptivesamples.com/how-to-install-ffmpeg-on-windows/ 3. 'pip install pydub', then copy some sample code from here and make slight adjustments to match your file paths and song file name: https://github.com/jiaaro/pydub 4. Run the script: from pydub import AudioSegment song = AudioSegment.from_wav("G:/Music/Rock/The I Don't Cares/Wild Stab/Sorry for Tomorrow Night.wav") song.export("Sorry for Tomorrow Night.mp3", format="mp3") 5. Email the mp3 file to Sam. And do...

97 Things Every Programmer Should Know

This collection of short articles about programming best practices is well worth perusing. Courtesy of O'Reilly Media.

In Appreciation of Procedural Programming

I think the lack of reusability comes in object-oriented languages.... [T]he problem with object-oriented languages is they've got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle. -- Joe Armstrong

Beatiful Day, Sox @ Yankees Tonight

Beautiful day today, and the Sox play their first game of the 2014 season against the Yankees tonight in the Bronx. Birds are chirping outside, and I can hear the last touches being put on a new bridge over the creek down the hill. An excellent day indeed.

Install the JDK Development Version on CentOS

If you want access to Java tools like jar and javac, install the development version of the JDK. # yum install java-1.7.0-openjdk-devel Add the bin directory to your PATH so you can run the Java programs from anywhere. # PATH=$PATH:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.25.x86_64/bin View the classes in a jar file. # jar tvf dt.jar      0 Mon Jul 01 09:51:04 EDT 2013 META-INF/     71 Mon Jul 01 09:51:04 EDT 2013 META-INF/MANIFEST.MF      0 Mon Jul 01 09:51:00 EDT 2013 javax/      0 Mon Jul 01 09:51:04 EDT 2013 javax/swing/   4486 Mon Jul 01 09:51:04 EDT 2013 javax/swing/JSliderBeanInfo.class   3342 Mon Jul 01 09:51:04 EDT 2013 javax/swing/JFormattedTextFieldBeanInfo.class   3025 Mon Jul 01 09:51:04 EDT 2013 javax/swing/JMenuBarBeanInfo.class