Page 1 of 2
Export of Track Lengths
Posted: Mon Apr 29, 2019 7:57 pm
by machineghost
One not uncommon (I'd imagine) use for Audacity is to record audio for presentations. To sync such audio up with slides/video, one needs to know exactly when one track stops and another begins.
In other words, one needs a list of the lengths of each track, eg.:
1: 1:30.234
2: 1:11.123
3: 2:01.429
Currently the only way to extract such info is to go track by track, highlighting each track, looking at it's length at the bottom of the screen (I don't know how blind users could even do this), and then typing it into a separate text file (and then doing the same thing for every track in the file).
However, Audacity has all this info available, so generating such a list should be trivial for it. If you'll forgive some pseudo code ...
output = '';
for trackIndex in file.tracks:
output += trackIndex + ': ' + file.tracks[trackIndex].length + '\n'
giveUser(output)
Whether Audacity actually generates a .txt file, or simply displays the track length list in a modal, the point is that if there was simply a menu option that let users "Extract Track Lengths", it would provide a huge benefit (for the subset of users who need this info) ... and again hopefully should be pretty easy to generate.
Re: Export of Track Lengths
Posted: Mon Apr 29, 2019 10:05 pm
by steve
In Audacity 2.3.1:
Enable the "Extra" menu (
https://manual.audacityteam.org/man/view_menu.html)
Then in the Extra menu > Scriptables 11 > Get Info (
https://manual.audacityteam.org/man/ext ... es_ii.html)
Select "Tracks" as the command, and either JSON, LISP or Brief as the format. (
https://manual.audacityteam.org/man/ext ... l#get_info)
If the format is "Brief", the start and end times of the track are shown after the "kind" of track, for example, the highlighted numbers below are the start and end times in seconds:
"Audio Track" 0 1 "wave"
0 30 0 1 1 0 0 -1 1
Re: Export of Track Lengths
Posted: Mon Apr 29, 2019 10:45 pm
by machineghost
Well that was so clear and obvious, no wonder I didn't find it on my own!
Seriously though, thank you so much for that answer, it will help me a lot.
However, I don't think this really solves the problem for anyone but me. Ideally this "ticket" should be converted into a "make this task possible for an ordinary human being who isn't an Audible developer or forum admin to accomplish".
Re: Export of Track Lengths
Posted: Mon Apr 29, 2019 10:47 pm
by machineghost
Actually I take that back; my "extras" menu has no "Scriptables" option at all ("Scriptables 11" or anything else).
Re: Export of Track Lengths
Posted: Tue Apr 30, 2019 12:50 am
by steve
machineghost wrote: ↑Mon Apr 29, 2019 10:45 pm
"make this task possible for an ordinary human being who isn't an Audible developer or forum admin to accomplish".
I'd have thought that most "ordinary human beings" would be capable of looking in the Selection Toolbar (which should be readable by Jaws for VI users). I was just giving a tip about an "advanced" feature (for "advanced users"

)
machineghost wrote: ↑Mon Apr 29, 2019 10:47 pm
my "extras" menu has no "Scriptables" option at all ("Scriptables 11" or anything else).
Which version of Audacity do you have?
Re: Export of Track Lengths
Posted: Tue Apr 30, 2019 1:10 am
by machineghost
steve wrote: ↑Tue Apr 30, 2019 12:50 am
Which version of Audacity do you have?
2.2.2 (Linux)
steve wrote: ↑Tue Apr 30, 2019 12:50 am
I'd have thought that most "ordinary human beings" would be capable of looking in the Selection Toolbar (which should be readable by Jaws for VI users). I was just giving a tip about an "advanced" feature (for "advanced users"

)
Hey man, the "ordinary humans" bit was just me giving you a user's perspective, because as a developer myself I know how easy it is to lose that (there's a reason companies pay huge sums of money for usability studies where they essentially just watch people use their software; if developers could just "think like a user" they never would pay for such things). And I thought the smiley (and following text) indicated that I was being tongue in cheek, and not rude or dismissive of your effort to help.
But look, if you sincerely believe that those steps you outlined are the best way for people who want to use Audacity for presentations to get track lengths, and you sincerely believe that all those people will be able to figure out those steps you outlined (without coming here and getting you to outline them), then one random person in a forum thread (bug ticket?) like myself saying "maybe there could be an easier way" certainly won't be able to convince you otherwise.
I just thought that, like myself, you would want people who use your software to be able to do so, easily, and I was providing feedback to the effect that right now, for me (data point of one) it's
not. But since it might have gotten lost in this text-based medium, I'll be explicit: I very much appreciate your assistance, and any "negative feedback" I provided was
only to suggest an avenue for improving the program, no in any way to be unappreciative.
Re: Export of Track Lengths
Posted: Tue Apr 30, 2019 1:32 am
by steve
The "Scriptables" are a new feature (and still under development). They are only available in very recent versions of Audacity (sorry, I don't recall exactly when they were introduced - possible 2.3.0).
machineghost wrote: ↑Tue Apr 30, 2019 1:10 am
I was being tongue in cheek
Me too, hence the smilies

Feedback is very much appreciated.
machineghost wrote: ↑Tue Apr 30, 2019 1:10 am
if you sincerely believe that those steps you outlined are the best way for people who want to use Audacity for presentations to get track lengths
I think that for the vast majority of Audacity users, the exact track length is not particularly important. Out of the 50,000+ forum topics, there have been very few requests for text output of track lengths.
We do have some related feature requests logged:
Other analytical/statistical ability:
...
Track sample data: headroom to dBFS (audio level), peak minimum and maximum sample, RMS volume, replay gain etc. see SF, Wavelab, Cool Edit etc. over an arbitrary length of audio, even the whole file. (8 votes)
Allow export selected audio and/or Export Multiple to name files with start and length (or end) of the selection (1 votes 02May17)
Permanent indication of/add box for total length of project: (6 votes)
- This should be "end-time" minus "start-time", so ignoring white space at the start (1 votes)
- Show project length when Length button is selected with no region selected (1 votes)
Separate time displays for End and Length Very useful to see both at the same time(2 votes)
The feature request page is here:
https://wiki.audacityteam.org/wiki/Feature_Requests
If you would like to "vote" for any of these features, or would like your suggestion to be logged as a separate item, then I'd be happy to log that for you. If the latter (separate item), please suggest wording to make it clearly distinct from the current suggestions.
And please note that as a relatively new feature, the Selection Bar now has options:
- Start and End of selection: the start time and the end time of your selection (default setting)
- Start and Length of selection: the start time and the length of your selection
- Length and End of selection: the length and the end time of your selection
- Length and Center of selection: the length and the time at the center of your selection
(
https://manual.audacityteam.org/man/sel ... onposition)
Re: Export of Track Lengths
Posted: Tue Apr 30, 2019 7:02 pm
by machineghost
Thanks again!
I do realize that this is only a concern for the subset of Audacity users who use the tool for presentations, and I have no idea how big that subset is; I just know that this feature would be very useful to that subset. My hope was that even if that subset was relatively small, the easy of implementation
might help justify making the (hopefully small) effort to support them ... but I
completely understand if it isn't.
I tried searching the feature request page but couldn't find anything except for:
- Import/Export of envelope points: as XML file
- Import/Export playlist file like M3U/PLS
.. and I don't
think either of those would output the necessary information (but they might)?
I hate to make someone else do work for me, but strangely even though that page is a wiki I can't just sign up for an account (even with a CAPTCHA or something), so I guess I have to ask you to edit it for me? Could you please add the following bullet point to the end of "Other Import/Exports":
Ability to export track length data as a text file (or even just as copy/paste-able text in a dialog). Use Case/Rationale: Audacity users who build presentations (where each track corresponds to a particular slide or other visualization in the presentation) need to know the length (and/or the exact start/end time) of each track, and the only way to get this information currently is to hand type it after selecting each track individually.
Also, if I could make just one more suggestion, if you want feature requests submitted some other way (eg. via the page you linked ... although it's not editable so I don't know how anyone could request a feature there) it might make sense to link to it on this page:
https://wiki.audacityteam.org/wiki/Reporting_Bugs ... along with some text to the effect of "maybe you don't want to be here at all, maybe you want to go request a feature".
And one more time, just for good measure ... thanks for taking the time to help me with this "ticket"!
Re: Export of Track Lengths
Posted: Tue Apr 30, 2019 9:35 pm
by steve
machineghost wrote: ↑Tue Apr 30, 2019 7:02 pm
Ability to export track length data as a text file (or even just as copy/paste-able text in a dialog). Use Case/Rationale: Audacity users who build presentations (where each track corresponds to a particular slide or other visualization in the presentation) need to know the length (and/or the exact start/end time) of each track, and the only way to get this information currently is to hand type it after selecting each track individually.
That could be done quite easily with a Nyquist plug-in, though it would require a fairly recent version of Audacity.
I'm not sure if your version will be new enough, but you can try this "proof of concept" code in the
Nyquist Prompt effect.
If the debug window does not open automatically in your version, try using the Debug button.
Code: Select all
;nyquist plug-in
;version 4
;type analyze
;debugflags trace
(setf *float-format* "%.2f")
(format t "~s Start: ~a End: ~a Length: ~a~%"
(get '*track* 'name)
(get '*track* 'start-time)
(get '*track* 'end-time)
(- (get '*track* 'end-time)(get '*track* 'start-time)))
""
Re: Export of Track Lengths
Posted: Wed May 01, 2019 8:37 am
by waxcylinder
A workaround would be to
1) Select each track in turn
2) Label each selected track in turn with a clear identifiable label
3) Use File > Export > Export Labels... This will list out the start and end times of each track
4) import the label text file into Excel
5) add a simple formula to calculate the length
See:
https://manual.audacityteam.org/man/fil ... ort_labels
Feature Request: it would be cute if the Export Labels calculated the length and listed that too
WC