The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Vim, Ruby, and Family History

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jamis Buck

Posts: 184
Nickname: minam
Registered: Oct, 2004

Jamis Buck is a C/Java software developer for BYU, and hacks in Ruby for fun.
Vim, Ruby, and Family History Posted: Dec 13, 2004 9:35 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jamis Buck.
Original Post: Vim, Ruby, and Family History
Feed Title: the buckblogs here
Feed URL: http://weblog.jamisbuck.org/blog.cgi/programming/index.rss
Feed Description: Jamis Buck's corner of the blogging universe. Mostly about ruby, but includes ramblings on a variety of topics.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jamis Buck
Latest Posts From the buckblogs here

Advertisement

On the side, I’m an aspiring amateur genealogist and family history researcher. My latest “thing” is to record my grandparents talking about their childhood, and then transcribe the recording and organize it into a book format. To that end, I’ve got an hour and a half of audio in OGG format of my grandfather telling about his childhood, his experiences in WWII, and so forth.

My wife, who worked as a personal history transcriber in college, has a transcribing machine. It’s like a bulky tape recorder, with doodads for speeding up or slowing down the playback, and for jumping backwards a few secodns in the recording. Also, when you pause the recording and start it again, it automatically jumps back a few seconds. These features are essential for transcribing audio.

Thus, given the OGG recording of my grandfather’s history, I have been looking for a program that has the features of a mechanical transcriber, especially for linux. The few programs that seemed to come close were either ugly as sin and not very stable, or had no support for OGG files. (True, I could always just convert the OGG file to something else, but I wanted to make the process as painless as possible.)

I then experimented withing using the Ruby bindings to GStreamer, to write my own transcribing program. It almost worked, but the problem I had with GStreamer was that it is buffered, for streaming audio, which means it doesn’t behave very responsively when I want to pause or fast-forward. (That was my experience, anyway.)

So I went looking elsewhere. I had heard of the FMOD library, but couldn’t find any Ruby bindings for it. I wasn’t particularly in the mood for writing the bindings myself, in C…but wait! I wondered if the DL module in Ruby could help me…

The DL module allows scripts to access C functions directly, without intervening glue code. It turned out to be ridiculously simple to write a Ruby module that calls into the FMOD routines via Ruby/DL.

So I took the Simple Audio Player demo from the Ruby/Gnome2 project and reworked it so that it used my FMOD layer instead of GStreamer. Then I added a slider to manipulate the playback rate, and made the “pause” button also rewind the audio a few seconds. Voila! A transcriber program!

Now, the problem was that there was no convenient way to manipulate my transcriber via Vim, my editor of choice.

I sat down and hacked some named pipe support into it. This allowed me to write a Vim plugin (in Ruby, naturally) that communicated with the transcriber over the named pipes, sending commands and receiving responses. Then I mapped the plugin’s commands to some convenient keys, and away I went. It worked flawlessly.

I wanted to share this contraption I had devised, but the setup was rather horrendous. You had to have GTK2 installed, and due to the dependency on named pipes, it would only work on Unix-like systems.

However, if I could write Vim plugins in Ruby, why couldn’t I write the entire transcribing system as a Vim plugin? Then the only dependencies would be FMOD, and a Vim that was compiled with Ruby support.

It turned out to be very simple to convert. I now simply load a file to transcribe with the :VSLoad command, start it playing with :VSPlay, toggle the pause with ctrl-space, speed it up with alt-rightarrow, and so forth. (I’ll probably register a RubyForge project soon, to host this and a few other genealogical utilities I’ve written.)

Meanwhile, I’ve got about 14 minutes of my grandpa’s 90 minute narration transcribed. A few more weekends should see the transcribing completed!

Read: Vim, Ruby, and Family History

Topic: Ruby 1.8.2 Preview 3 is available Previous Topic   Next Topic Topic: The power of a friendly community

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use