Tag Archives: audiobooks

Punch and Roll for Audacity in Linux using Autokey

audacity_logoMost of my friends know that as a side-line I narrate books for Audible.Com, and they might also know that I’m a Linux nerd, too.  Where those interests intersect, there is a wonderful open-source program called Audacity, which is a Digital Audio Workshop, that is, a program in which you can record, edit and master digital audio.  Musicians, narrators and voice-over professionals use such programs every day. Audacity, in addition to being jammed with features and options, is free. It’s the very tool to reach for if you are a dabbler, or on a constrained budget, but serious about doing good work.
Unfortunately, Audacity  lacks one capability which narration and voice-over, in particular, makes heavy use of, and that is a tool called “punch and roll”.  “Punch and Roll” allows an audio book narrator to edit mistakes “on the fly” while reading. It works like this: the reader hears himself flub a line or a pronunciation, stops recording, places the start-point line just upstream from the mistake, and hits “punch and roll”. Then these things happen automatically: the start-point jumps upstream an additional pre-set number of seconds (2-3 seconds are typical), the system starts playing the audio for the narrator to hear. As the time-line reaches the marked “flub-point”, the system stops playing, and begins to record. The narrator picks up reading, correcting the error, and the recording proceeds, as before, with the edited audio right where it belongs.

Ideally, the program should preserve both the original audio (the one containing the error), as well as the corrected stream. That may sound odd, I know, but is no less true. It doesn’t happen often, but it can be very important at times to have the original stream of audio, to fix subtle issues found much later on.  Being able to revert to the original version with the tool is called “non-destructive punch and roll”.

So, how can we do all this in Audacity? First know this: the Audacity DAW has versions that run in Windows and Mac, as well as Linux, and there have been a few clever people who have solved this problem for those systems already. My “punch and roll” solution for Audacity in Linux has been adapted from a solution posted by Steven Jay Cohen which works in Mac OSX. Cohen’s written a short piece of code that runs in AppleScript, to execute the correct keystrokes to allow non-destructive punch & roll in Audacity on a Mac. A bit of googling will also locate scripts that will achieve similar results using “AutoHotKey” on Windows computers.  My solution for linux makes use of a powerful macro utility called “autokey”, which runs scripts in the python programming language.

Here’s how to obtain punch and roll in Audacity on an Ubuntu/Debian linux computer:

1. Install autokey. On a gnome-ubuntu machine, from the command line run:

sudo apt-get install autokey-gtk

2.  From the desktop, launch the program menu, then Accessories, AutoKey. This should open the Main Window of autokey, and also place the autokey icon, a capital “A”, in your program tray.

The main window looks like this:

AutoKey Main Window
AutoKey Main Window

Now you are going to add a new script to the existing library you see on the left side of the main window. Do these:

1. Click where you see “+New”, choose Script from the menu, then give your script an appropriate name in the dialogue box. I called mine Punch&Roll.

2. Notice on the right side the box where you will input and edit your script. It’s marked # Enter script code:

#Enter Script Code
#Enter Script Code

blogYou will be pasting the code right below where you see:

# Enter script code

For those of you unused to working with programs, understand that where you see a hashtag (#) at the beginning of a line, the computer ignores that line when running the program. If you are modifying this script to troubleshoot it, you could insert a hashtag at the start of a line to remove it temporarilly from the program, or to create a note for yourself about what the next line is supposed to do.

Here’s the script that works for me. It sets 3 seconds of pre-roll:

##‭ ‬Autokey script to enable Non-Destructive Punch&Roll
‬##in Audacity using AutoKey.
#The number of “,” below sets 3 seconds of pre-roll.
#Below, (” “) encloses one press of the space-bar.
keyboard.send_keys‭(” “)
#Number for time.sleep below should equal number of (“,”).
#Delay for sleep below makes resume-record work.

After copying this into the script editing box in autokey, do three more steps:

1. Set a hot key for the script, by clicking on the button below the script marked HotKey….Set. Then in the dialogue box that opens, click on “Press to Set”.  Choose a hot-key combination that doesn’t conflict with any other program or function: I recommend a combination of the <super> key (also called  the <windows> key) and the “z” key. So press and hold <super> and then press “z”. Then press Ok. You should see <super>+z has been set as your hot key.

2. It’s wise to set a Window Filter, so that your hot key will only be activated within Audacity. Where it says Window Filter, press Set. In the dialogue box where it says “Regular expression to match”, type in   Audacity.Audacity   ,  just like that.

3. Lastly, save your work: Click up above where it says Save, or simply press Ctrl-s.

Now, to use “punch and roll”, you need to set up Audacity very specifically for the script. It expects you will have two mono tracks above a label (bookmark) track. Audacity will launch a new track as soon as you begin recording, so I do these steps to get started:

1. Make sure AutoKey is running in the background (the “A” shows in the tray below on the right side).  Now launch Audacity, and make a short recording of 5-8 seconds.

2. Press “Ctrl-Shift-n” to make a second mono track below the first.

3. Press “Ctrl-b” to make the label track.

The top-most track is your production track. The next one down is your Edits track and will accumulate your saved mistakes as you stop, set, and then punch/roll to fix “flubs” on the fly.  It should look something like this:

Set up these tracks: Production, Edits, Bookmarks
Set up these tracks: Production, Edits, Bookmarks

To try it, you need to start with the time-marker set within the short piece of audio you recorded to launch the production track.

1. Put it near the end, but not all the way at the end.

2. Press <super>+z, and you will see the time marker jump back 3 seconds, play those three seconds, and then append a new recording to the production track as it reaches where you started.

You will also notice that all audio AFTER your start point will have been moved to the second audio track, where it will be saved, in case it’s needed to fix something. Here’s what it should resemble:

After one "punch & roll". Notice that my Edits track is muted, so it doesn't distract me as I re-record.
After one “punch and roll”. Notice that my Edits track is muted, so it doesn’t distract me as I re-record.

So there you have it! Non-destructive punch and roll for Audacity in Linux. My deep appreciation to Steven Jay Cohen for his excellent post explaining this process for Macs, without which this technique would still be a mystery to me.


‘The Calamari Kleptocracy’ – A New Audiobook!

"The Calamari Kleptocracy" by Nicolas Sansone — cover image

Spoken-Arts.Swiftpassage.com and All Things That Matter Press are delighted to present Nicholas Sansone’s ‘The Calamari Kleptocracy’, my second narration project,  available now from Audible.com and iTunes. Click to hear a sample from the book:

Chapter 1

‘The Calamari Kleptocracy’ is a loss of innocence tale, the story of Thor Gunderson, a cheerful and congenial young man whose life is about to take a series of wild jolts and shocks as the people in his world each, one by one, bring Thor lessons in the complexity of human nature, and the existential character of the universe in general.

Sansone’s novel is ingenious for its capacity to craft a seeming allegorical  America, which ultimately proves to be barely an allegory at all. It is, rather, a clearer vision of the plight of our nation in economic turmoil.  Common people work hard, but don’t prosper. The rich get richer, and use the common folk as their pawns. The land of opportunity exists only as a memory of a dream.

The view-points and writing of Sartre, Brecht, and Ionesco all echo in this novel, but with their European existentialism adroitly imported and adapted to our native landscape. That mirror now reflects the hardships and harsh realities of an America enduring a crippling economy, turbulent sectarian divisions, encroaching Fascism, and a corruptly parasitic oligarchy.

But don’t be dismayed by the weighty underpinnings of this story. For all the complexity of the novel’s philosophical bones, the  surface of the tale is  light and humorous, and parades characters and events which are by turns sweet, amusing and colorful, before leading us with, at times, brutal honesty to the way things really are.

And how is that? Big business manipulates and gobbles up individual businesses. Individuals are manipulated into collectives against their own best interests. “Opportunity”  has vanished from the American landscape. The prosperous prey upon an ever-shrinking and downwardly mobile middle class, an astonishing number of whom enter into incarceration in for-profit prisons. And yet there is always to be found light within human life: This was one of Ionesco’s clearest truths, which Sansone, too, demonstrates over and again,  with a precise eye for the light, color, and minute details that fill the space in which his story unfolds.

Another brilliant aspect to Sansone’s story-telling is that he never demonizes anyone. All his characters, even the most corrupt, are complexly human mosaics of traits good and bad; full and simple at once.

For that, and many other reasons, I loved working on this audiobook presentation of Mr. Sansone’s novel. Find it today at Audible.com  !

So, Now I’m A Narrator: Audible.Com and ACX


Narrated by Elliott Walsh; available now at Amazon.com!

A sample from ‘Headwind’, the audiobook.

Old friends who know me well are familiar with my theatrical past.  There was a time, in another life, when I majored in Dramatic Arts at Boston University. I studied and worked hard at becoming a professional actor. I’ve been in plays and musicals off and on for many years. I’ve performed in New York City and Boston, albeit not profitably. My interest in theatre makes me keenly appreciative of good work when I see it, both the writing and acting; mostly in watching films or broadcasts, these days.

There’s scant opportunity to perform, though, in part because where I live is such a long drive to anyplace where a scrap of performance is happening. After a day at the hospital, it’s unthinkable to drive almost an hour north or south to keep a rehearsal or performance schedule, so I’ve steered clear of auditions. There has been a bit of “flash theatre” once or twice, when I could participate in a 24 hour play project, most recently in Brunswick a few months ago, but that’s another story.

What I have done to exercise those old actor’s reflexes and skills is to try my hand at auditioning for audiobook narration. A while back a writer friend brought ACX to my attention. ACX is the Audiobook Creation eXchange, a division of Audible.Com, which is, in turn, a subsidiary of Amazon. They are a clearinghouse for Authors, Rights-holders, Narrators, and Producers, and mediate between them to foster the recording and marketing of new audiobooks.  It’s really an amazing idea, and has garnered the support and enthusiasm of first rate authors, like Neil Gaiman or Janet Evanovich, and top o’ the line publishing houses, as well.

It works like this:  If you think you have what it takes to narrate someone’s book into a finished product, go create a narrator/producer’s account at ACX . You will be encouraged to flesh out your profile, and upload audio samples of your voice, which authors and rights-holders can find and listen to.  You can also browse a significant catalogue of projects seeking a narrator. They can be searched with filters leading you to projects that fit your gender, voice-style, and age. You can also filter for fiction vs. non-fiction, or for specific genres, such as mysteries or sci-fi.

The projects will be presented with myriad information; date of publication, length, author’s notes, etc, and an audition script will be attached. I hunted up a number of projects I thought would scratch that old actor’s itch, and recorded a trio of them one Saturday morning. The matter of preparing the tracks so they might present well is a whole other story. There is a learning curve for recording techniques, but I got started with a $2 electotet condensor mic, and  free, open-source recording software, called Audacity.

To my total surprise and delight, I had a quick response to one of my first auditions, a light crime genre novel called ‘Headwind’ by Christopher Hudson. Chris liked what I’d done with a lot of my audition, but wanted me to try some different voicings, too. I re-worked the chapter, and re-submitted it. With a bit of back and forth, we’d found a good fit between what he hoped for, and what I could do. With another click or two on the project page at ACX.com , we had a contract to make an audiobook!

At that point, I ordered some pieces of serious recording gear; a better microphone (the Rode NT-1A, which rocks, btw!), a stand, better headphones, and a USB interface to connect the mic to the computer. Which brings me to another great thing about ACX: They have pages full of wonderful tips, pointers, and training videos on how to set up a recording space, how to record, edit, and polish the finished tracks. They really want you to succeed!

And here it is,  now finished and available for purchase, the audiobook of ‘Headwind’ by Chris Hudson, and narrated by yours, truly! Find it at Amazon  or through Audible.com

And if you enjoy a good car chase scene…   Please visit my professional web at Spoken Arts .