Category: Projects

Ghostbusters MAME Arcade Cabinet Complete

The t-molding came in on Friday and I had some time on Saturday, so I installed the t-molding and finished up the project. I took some pictures of the control panel on the finished arcade.

I don’t have a router, but a coworker’s father was in town with all of his tools and he finally give me the means to finish the project. When I tried to install the t-molding at first there were some areas that weren’t deep enough. I used my dremel to make the slot deeper all the way around. I wouldn’t have been able to do that with the dremel alone, but since there was already a slot it helped. I have a depth guide that I attached to the dremel to make it work. I didn’t even need any glue! I just put the t-molding around the outside. Using a towel as a cushion I tapped the molding in place. The hardest part was cutting the v-shaped notches in the “t” part of the molding so it would go around the corners. Since this t-molding also had a lip I had to cut that, too. The lip was necessary to keep the vinyl down around the edges. For some reason the adhesive didn’t work very well around the edges and it wanted to come up.

I attached the top piece with the controls to the bottom piece with two hinges on the front side and a catch on the other so I can flip it up from the back to work on the wiring underneath. You can see the control panel wiring in the Unfinished section of the gallery page.

The Arcade cabinet came with a control panel, but it only allowed 2 buttons per player and the joysticks weren’t very good. The new configuration is also somewhat narrower so the machine can now fit through most doorways without taking off the control panel and the box it is on. Now that it’s done I’ve got exactly what I had envisioned!

Now, to work on that Donkey Kong high score…

Arcade Control Panel

Record Streaming Audio with Linux: Part I

Update: For a better solution check out this newer post

I happen to enjoy listening to Glenn Beck. The problem is that I can’t receive his weekday shows where I live. Even if I could receive his weekday show over the air, I wouldn’t hear most of it because I am busy working all day.

The solution: cron and mplayer with a little help from sox.

Here’s a sample script:

#!/bin/bash
# Use mplayer to capture the stream
# at $STREAM to the file $FILE

DATE=`date +%d-%b-%Y` # Save the date as DD-Mmm-YYYY
YEAR=`date +%Y` # Save just the year as YYYY

# Where you want the file saved. Leave off file extension
FILE=/home/shawn/PodCasts/Glenn_Beck_Show_$DATE

# The following file should be a playlist file such as .asf or .asx
# You can also create your own file with a URI and put it here
STREAM=/home/shawn/bin/glenn_beck_show-6-9am
DURATION=3.1h # enough to catch the show, plus a bit
#DURATION=200s # a quick run, just for testing

# For the id3v2 Tags
AUTHOR="Glenn Beck"
ALBUM="104.7 WPGB-FM Pittsburgh"
TITLE="Glenn Beck Show - $DATE"

# Capture Stream
/usr/bin/mplayer -really-quiet -cache 500 \
-ao pcm:file="$FILE.wav" -vc dummy -vo null \
-playlist $STREAM &
# the & turns the capture into a background job
sleep $DURATION # wait for the show to be over
kill $! # kill the stream capture

# remove gaps and convert to mono
sox $FILE.wav -c 1 $FILE-silenced.wav \
silence 1 -0.9 2% -1 -0.9 2% ;
rm $FILE.wav ; #remove original capture

# Encode to .mp3, mono 32kHz 32kb/s, and tag the file
lame -a -m m --tt "$TITLE" --ta "$AUTHOR" \
--tl "$ALBUM" --ty "$YEAR" --vbr-new -V 9 \
--resample 32 $FILE-silenced.wav $FILE.mp3 ;
rm $FILE-silenced.wav # Remove the raw audio data file

Once all of the variables have been set, make this executable and make a cron job for it.
crontab -e

Here’s an example for starting at 6am every weekday:
0 6 * * 1-5 /home/shawn/bin/glenn_beck.sh >& /dev/null

Notes

  • The basis for this script is the one found at this Linux Journal article.
  • You need at least SoX version 12.17.9 for the silence filter to work properly.
  • MPlayer should be fairly recent. Older versions have a different syntax for pcm (wav) audio output
  • This solution still requires huge amounts of disk space (~500MB/hour). I am still experimenting with using named pipes (fifos) to do all of the file processing in RAM and only output the final encoded file to the disk.