Option to copy audio position information

When loading an audio file in Audacity, you can see the audio position of the cursor on the bottom.
For example: 00h04min24.653sec
When clicking on this field, you can change the format to seconds, frames, samples etc.

I would like to be able to copy the value of this field (no matter what format it is) to the clipboard.
Of course I’ve already tried right-clicking on the field or just Ctrl+C - nothing worked.

Can you please add the possibility that users can copy those values?
Would be very useful for audio position, and optionally for start and end of selection.


To do what with it?

This short code can be run in the Nyquist Prompt effect to give the start of a selection in seconds (the caveat being that the Nyquist Prompt effect requires playback to be stopped, and for there to be an audio selection):

;version 4
;debugflags trace
(format t "~a~%" (get '*selection* 'start))

Use copy and paste to ensure that you enter the code exactly as written.
(The two double quotes at the end are required in this code)


It’s indeed an interesting way.
I tried it and the first impression was good.

Why I need this information?
I want to cut the silence of many MP3s at the end of the track.
However, instead of re-encoding them, I’ll use another program which just cuts them.
With Audacity I find out the starting point of the silence and the whole song length.
I store everything in an Excel table.
(I created AHK scripts for that.)


P.S. But you might remember the wish anyway to add Copy support for these fields… :wink:

How many is “many”?

If it’s not a huge number, you could do the whole job (apart from automating the trimming) with MP3Split (or similar).

If it is a huge number, then it would be possible to write a script for Audacity and batch process the files to give a text file output something like:

name-of-file  123.4216
name-of-other  120.1000
yet-another  67.213

It’s like 2000 files, but there could be even more.

I’m not sure if a batch might do the job, because I need to find out the start of the silence for each track.
I use an AHK script for that.
Loop start

  • open mp3 file with Audacity-
  • jump to end
  • move cursor x seconds back
  • start playback
  • check if there is silence → if yes, pause, copy audio position info, paste it to Excel
  • exit
  • select next file
    Loop end

Is it with Niquist also possible to get the total length of the track?
Your code is fine, but would be even better if I have a second value that is the total length.

P.S. For cutting I would use mp3directCut. - To be honest I haven’t checked if an AHK script might be useful there too (as for AHK)


If the track starts at time = 0, then you can get the end time with:

(get '*track* 'end-time)

If the track may start earlier or later than time = 0, and you want the length, then:

(- (get '*track* 'end-time) (get '*track* 'start-time))

Perhaps you could use, or adapt Silence Finder Silence Finder - Audacity Manual

I’d like to add my vote for this feature request please. I use audacity to find the end of songs and then enter that number into OSX Music.app as a “stop time” in the track’s options. very similar to @4ud4cit4t0r use case.

I’d also like to copy the timestamp. I need it to use with ffmpeg to split a recording into multiple files.