New Audacity Functionality: Real-time editing


I’m a member of LibriVox, a volunteer organization to record public domain texts. Due to the volunteer nature of this organization, many of us use Audacity as our recording and editing software.

We were brainstorming some ideas about how to streamline our production process. It seems that other recording software has the ability to allow the user to edit their recordings in real-time (i.e. delete mistakes while recording). This feature is a huge time-saver, as evidence by the prodigious throughput of our users who have software with this functionality.

Real-time editing in Audacity is not easy or convenient. Make a mistake, stop the recording, find the beginning of the mistake, delete it, restart the recording, try to match the tone of voice and cadence, go back and merge all the new tracks that have been created by restarting the recording all the time. At this point, it’s faster to just edit out your mistakes later.

Perhaps there is a better way to do this already in Audacity? But if not, we had the idea of adding the ability to easily stop the recording, rewind to a cue, and restarting the recording, all at the touch of a single button. Here’s the idea:

  1. Start recording.
  2. At various points, set “cues” by pushing a hotkey. Say, add a cue at the beginning of each paragraph as you read.
  3. If you make a mistake, press a hotkey.
  4. The recording stops.
  5. The cursor jumps back to the nearest cue.
  6. Play a prompt (playback five seconds of audio prior to the cue) to allow the user to match the tone of voice and the cadence.
  7. Restart recording [on the same track] at the cue.

Does Audacity have any functionality similar to this already? If not, I’m going to see about adding it. I am fairly adept with C++ and GUI programming, but I am not familiar with the Audacity code base, so I could use some advice/hints/suggestions about how to structure this feature or where to begin. I have installed VC++, wx, and managed to get a CVS version of Audacity compiled and running.

Thanks for your help!


Hold on. I pinged one of the forum daddies.


Thanks, Koz. Daniel, I think the approach many take with Audacity as it is now, is not to stop the recording. Carry on recording after your mistake and use CTRL + M to drop a label or CTRL + B to draw a selection at the point concerned. Then you have your mistakes marked, and as appropriate either repeat the phrase in which you made the mistake (quite easy to repeat the same intonation/phrasing within the first 5 - 10 seconds of the mistake?), or if you sneezed or scraped a chair in between a sentence, you may want to just carry on. Either way, your points that need attentiom are marked for editing after the recording. If desired, the labels can contain a note of what the mistake was.

“Stop the recording, rewind to a cue, and restart the recording”, can’t of course currently be done all at the touch of one button which you hit when you make a mistake. Similar functionality in multiple steps is in the Beta version. You can drop labels at your cues as described above. You’ll have to stop recording where you make your mistake, because you can’t drag back the recording cursor while it’s paused. Click in the label track that holds the created labels, and SHIFT + tab to go back to the previous label. The playback cursor will now be at the label point. Move your mouse a few seconds to left of the cue and press B to play from the mouse to the start of the cue. If your label was a selection, you can use C instead to play a chosen length before (but also after) the selection.

Here the analogy (almost) breaks down. There is a SHIFT + R hotkey to record in the same track, but all it will do is start recording at the end of the track at the point you stopped; the only way to record from the label point is in a new track with the normal R (for record) hotkey. If you did not mind losing the cue point, you can SHIFT + K to select to the end of the recorded track, delete the selection, then SHIFT + R to restart recording from (what was) your cue point. But if you really want that cue point back, you can still CTRL + B (even after restarting the recording) to relabel the cue.

Where your idea will have a major implementation problem is if (as I think) you want to physically overwrite the existing recording (from the cue point). Doing that (known as “punch-in recording”) would have major implications and risks of breaking other things, and we have always resisted that idea for better or worse. Now would not be a good time to consider it either, as we are in the midst of many changes being worked on by students in the Google “Summer of Code” program. But in your case, if you can live with deleting from the cue point to where the recording stopped, and restarting from the cue, all you are really doing is writing a macro of pre-existing commands initiated by a hotkey. You could in fact run that with any suitable third-party macro program without the need to modify Audacity.

So the idea is interesting but I’m not sure if we’d be in a position at present to integrate it into Audacity (even if you did most of the work). I’d suggest if you want to pursue it you join our developers mailing list:

then drop us a line pointing to this post. We’re happy to see new faces with C++ skills, whatever comes of this idea, or if there is some alternative way of facilitating corrections in a recording take.




Thank you for the reply. I like your suggestions about how one might facilitate editing out mistakes. The only problem that I can see with the “ctrl+m” method of marking the mistakes is that the window focus needs to be on Audacity. While reading, I always have the window focus on the web browser (or text editor) so I can scroll through the text. Audacity runs in the background.

Do you know, off the top of your head, if wx has the ability to implement global hotkeys? If so, how about a new feature like this:

  1. Record
  2. If a mistake is made, press the global hotkey (e.g. ctrl+shift+m or something).
  3. Audacity adds a new label at that point with the text “Mistake” (or something).
  4. Focus doesn’t leave the recording track

This, I should think, would be easier than creating a “punch-in recording” feature, right?

What do you think?

Thanks for your help! :sunglasses:

(PS, I’ve joined the developer’s list, and I’ll send an email with a link to this discussion.)

A possible workaround:

ALT+TAB (change focus to Audacity)
Ctrl+M (drop marker)
ALT+TAB (back to the text program)


P (pause Audacity)
Ctrl+M (drop marker)
Name Marker (optional)
UP cursor (move focus back to audio track)
P (resume recording)

By resuming the recording and going back a short way in the text to a suitable point, you would just need to tidy up (delete the bad bits) around the marker positions.

Option B
Get a second computer for the text editor - an old 486 would do the job.

Thanks, Steve. Just to add to that, you could name the labels without pausing, but would need one up arrow or enter after the last label if you wanted to use spacebar to stop recording.

I don’t know for sure about Widgets supporting an application setting a hotkey that works in all programs. I suspect not, given I found people asking the same question on the internet without answer. However a sufficiently configurable macro program would do either your original idea using my sequence of Audacity shortcuts, or your much simpler idea in your last post - you could configure that shortcut for example to activate the Audacity window, press CTRL + M in Audacity, type M, then activate the text reader window. A few audio editors do let you create macros for this sort of purpose.

Whenever Audacity adds a label, the focus is always switched to the label track so that you can type in the label if necessary. But as explained above, that doesn’t stop recording continuing or further labels being added at the recording cursor. And if Audacity can’t itself create global hotkeys, then a feature to have its own hotkey to create a custom “Mistake” label hardly seems worth the effort. It would make more sense to me if we were to do anything, to have a feature where on pressing a shortcut (when the Audacity window was active), recording would stop and trim back to the last label, from where SHIFT + R (or perhaps the same shortcut) could restart it from the label. If there was no label, then the shortcut would delete the track and recording could restart from time zero. Any such shortcut would possibly have to be protected by a preference to turn it on, otherwise an unwitting user could halt recording of their live stream unintentionally (obvious shortcut combinations with spacebar are already taken).


Thank you for the reply. There seem to be a higher degree of resistance to this idea than I would have anticipated. Is editing Audacity code much harder than it ought to be, or do you, the development team, just want to hold off on adding features until after the next major release? Either way is fine by me; it would just be helpful to my planning to know which it is.

Thanks for your help! This is an awesome program y’all have created here. :sunglasses:

I don’t think that it is resistance to new ideas so much as trying to keep some sort of focus on the project objectives. (BTW, I’m not a developer, just an enthusiastic user).

As you can see from this wiki entry, there is a considerable list of features that people would like to see in Audacity:

Obviously, the development team are not able to incorporate all of these ideas at once, and doing so would probably make Audacity so complicated that it would not be desirable to do so. The current development of 1.3.x (beta) is leading up to the new stable release (1.4), so I would not expect that the developers are wanting to do any major rewrite of the code at this stage.

Posts that appear in this part of the forum, after allowing time for discussion by interested parties, find their way onto the feature request part of the wiki, and from their may find their way into the official “development roadmap”.

Current development is moving toward a more modular structure which should make it easier for other developers to create modules that customise Audacity for specific purposes, while keeping the core code development manageable, and the mainstream release versatile and simple enough for the majority of users.

Quite a few of the features that crop up here already exist and can be done easily with the current Audacity release. Other features can be accommodated quite easily with a slightly different working method (a workaround). Other features do indeed require a modification or addition to Audacity, and these are the ones that are most likely to end up in future releases.

As Gale Andrews (who is one of the developers) mentioned in an earlier post, people such as yourself with programming skills are most welcome to become involved with the development team, so if you have the time and inclination to do so, I refer you back to his post. For myself, I’ve not a clue about programming, so I try and help out here where I can.

Absolutely, and trying to make contributors’ ideas of sufficiently general applicability that they could be considered for mainstream Audacity is another consideration. Hence my suggestion that perhaps this feature should not be restricted to labels, and perhaps should not play up to the label and restart recording of its own accord. Maybe invoking the hotkey again could both play up to the label and restart? No automatic restart will certainly make your implementation task easier. Also consider in case this does go into mainstream Audacity what should happen if a selection region was being recorded - would the recording trim back to the start of the selection instead?

Martyn Shaw has now very kindly offered to help Daniel along. Incidentally I should add that I’m listed here as “Developer” because I am on the Audacity Team, but I am not really involved in C++ programming, so that was why I could not commit to helping you with that side of it.


Okay, that makes a lot of sense. Thank you for the replies. I can certainly understand how a poor developer’s attention can be pulled in a million different directions.

I’m planning to do the coding to implement this feature. I know that still means developers in the Audacity Team will have to answer my pestery questions and vet the new feature to be committed to CVS. But I really like the idea about using CTRL+M to add a label. I think if I can harness that idea into something even more streamlined, we might be somewhere. I’ll ponder it and get back to y’all with a more detailed suggestion :smiley:

Unfortunately, I’m very busy procrastinating on a variety of other projects at the same time :wink: so I don’t have a great deal of time to devote to this at present. But it’ll get there.

I just discovered this old thread. Has there been any action? Any continued interest?

I have found a pleasing way to do this on Windows with the AutoHotKeys program. I save my text as HTML and open it in a browser so it scrolls continuously.

Then I just click in that window, and hold a wireless mouse in my lap with a scrolling wheel. Wheel down saves a “cue” point – briefly stops and restarts recording. Wheel up will undo it to the most recent cue point – stop, undo, restart. Changing the focus from the browser to Audacity and back is done by the script – my cursor need not move at all. I move the mouse cursor only occasionally to operate the scroll bars and up and down arrows.

And I have certain key combinations to turn these actions on or off so I can do other tasks involving the mouse wheel.

No noisy keystrokes, or hitting the table that the keyboard is on. Just the noiseless mouse wheel.

I also cause the middle mouse button (depressing the wheel) to cause Audacity to pause or unpause, instead of its usual behavior. I have not implemented a replay of the few seconds before the break point but that could be easily done too. I could program XButton1 and XButton2 which are the sideways presses on the mousewheel to do such other things, leaving left and right buttons to their usual behavior.

Voila, useful extensions of Audacity without waiting for a new release!

There has been no action I am aware of.

It seems that global shortcuts are only supported by WxWidgets for Windows, which does not help.

I am certainly supportive (unlike many, I even think we could consider a quick and dirty aka “destructive” punch-in to erase the mistake - but I agree this is only suitable for replacing spoken word that has good gaps either side).

What do you use for your “cue point”?

Would you be able to share your script, for example on our Wiki?

I am sure someone would find it useful, or as an inspiration to make their own script.

If it’s OK with you I’ll count your interest as a vote for the “delete back to cue point and re-record feature”. Forgetting about punch-in features will tend to increase support for such an idea.


Please point me to a place where I should share the scripts. Or is this thread that place?

Eliminating outtakes as I go with recording, instead of doing a straight recording, is a big advantage. The pauses between sentences with frequent cue points might be less natural than with straight recording, but I take it as given that everything must be reviewed and adjusted, and I have invested my effort in easing that task too with some help from AutoHotKeys and Nyquist, as Steve and others from our other discussions.

We don’t have a place specifically for scripts (other than Nyquist scripts), so I’d say that this “Recording Techniques” board is probably the best place. Just start a new topic (new subject) on this forum board and give it an appropriate title so that it is clear what your post is about.

This board is a good place to store the scripts. Thanks for sharing them, Paul.

Possibly a new Wiki page containing tips about “Recording Books and Dictations” or some such could link to the script hosted here. The new Wiki page could be linked to on .

I don’t record books and dictations so I won’t be much help.


I did float an open ended invitation to discuss narrator’s techniques lately, but got few responses. I thought there were a lot of LibriVox people lurking here.

AutoHotKeys for Windows is a very useful thing. Do you remember my other complaint about the nuisance of cut preview not recentering the view on the selection? Now I can have that with one keystroke.

One thing about it though is that Audacity does not queue up the keystrokes it gets while doing some time consuming operation. That may be proper for human interaction, but it means I must program my hot keys scripts with delays between the keystrokes that are just guesses, and sometimes the strokes still get lost, so the hot keys don’t work with complete reliability. But still they are a great improvement.

My next project might be to see if I can use fft in Nyquist to analyze speech sounds and attach labels to the commonest kinds of crackles inside of words that need cleanup.

I think there are many thousands who use Audacity to record for Librivox, but only a handful of dedicated (or foolhardy :smiley: ) souls read this Forum every day. Generally, people post here just when they have a problem or idea to share.

I’m hoping if you do post your scripts that this will inspire some interest especially if we have a few lines about it in the Wiki.

Also you could post in the librivox Wiki to get a discussion going there.