Created
July 6, 2010 21:44
-
-
Save endolith/465964 to your computer and use it in GitHub Desktop.
Audacity selection duration plug-in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * duration.ny: Selection Duration (Version 2 plug-in) | |
| Once copied into your Audacity plug-ins folder, this plug-in | |
| utility appears in the analyze menu. It gives the duration of audio | |
| you have selected. A lot easier to use for people using a screen | |
| reader (rather than trying to decipher those numbers on the | |
| screen). | |
| If you have opened or imported more than one track and have not yet | |
| done a Quick Mix, this plug-in sequentially gives the duration of | |
| each track you loaded into Audacity. Simply press <enter> after | |
| each track duration is given. The final screen gives information | |
| from Nyquist, which you can ignore. Simply press <enter> to get to | |
| the regular Audacity screen. | |
| This is a Nyquist Version 2 plug-in which works in Audacity 1.2.3 | |
| and later. | |
| Thanks to Steven Jones and Dominic Mazzoni for Nyquist pointers. | |
| Written by David R. Sky | |
| Code help from Steven jones, Dominic Mazzoni | |
| updated January 2, 2006 | |
| Released under terms of the GNU Public license | |
| http://www.opensource.org/licenses/gpl-license.php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;nyquist plug-in | |
| ;version 2 | |
| ;type analyze | |
| ;name "Selection Duration..." | |
| ;action "Getting selection duration..." | |
| ;info "by David R. Sky, Steven Jones, Dominic Mazzoni\nReleased under terms of GNU Public License" | |
| ; Selection Duration by David R. Sky | |
| ; Code help from Steven jones, Dominic Mazzoni | |
| ; updated January 2, 2006 | |
| ; useful for screen reader users | |
| ; Released under terms of the GNU Public license | |
| ; http://www.opensource.org/licenses/gpl-license.php | |
| ; selection duration | |
| (setf dur (/ len *sound-srate*)) | |
| ; calculate minutes | |
| (setf minutes (truncate (/ dur 60))) | |
| (setf mins2secs (* minutes 60)) | |
| ; calculate seconds | |
| (setf seconds (- dur mins2secs)) | |
| (cond | |
| ((> len 999999999) ; >= 1 billion samples | |
| (setf len (/ len 1000000000.0)) | |
| (setf number 'billion)) | |
| ((> len 999999) ; >= 1 million samples | |
| (setf len (/ len 1000000.0)) | |
| (setf number 'million)) | |
| (t | |
| (setf number ""))) ; < 1 million samples | |
| (strcat | |
| (format nil "Selection duration is ~a ~a samples, ~%" len number) | |
| (cond | |
| ((= minutes 0) | |
| (format nil "or ~a seconds ~%" seconds)) | |
| ((= minutes 1) | |
| (format nil "or 1 minute ~a seconds ~%" seconds)) | |
| ((> minutes 1) | |
| (format nil "or ~a minutes ~a seconds ~%" minutes seconds))) | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment