automation : select & export data

Hello everyone,
I have a project to do an optical sound recording look alike, to do so I would like to know if there is a way to select 1/24 s of my single stereo sound track and export the data, then to select the next 1/24 s and export the data again and so on?
Its an easy task to do manually but as I have more than 15min of track I hope there is a way to do it automatically…
In order to achieve this goal my first question will be : is there a way to change the time selection with the console?

Could you give me some help, I am very new to the macro or Nyquist.

I hope my question is not too stupid, but I have a lot to learn.

You want 21600 files? :open_mouth:

I don’t know if this will work with so many files - it should, but it will be slow.
Test on a much shorter file first (a few seconds).

Modify the first few lines as necessary to suit your computer, then select the track to process, and apply this code in the Nyquist Prompt (See: Nyquist Prompt - Audacity Manual)

;; Change this line to suit your computer.
;; This must be the full path to the folder for the exported files.
;; Use "/" and not "\", even on Windows.
;; Example: "C:/Users/<your-user-name>/Desktop/My Test/"
;; The folder must exist.
(setf path "/home/steve/Desktop/Output Folder/")

;; File name
(setf fname "clip")

;; File extension
(setf ext ".wav")

;; Number of channels (1 = mono, 2 = stereo)
(setf chan 1)

;; Length of each clip:
(setf cliplen (/ 1.0 24.0))

;; Do not modify below this line.

(let ((dur (get-duration 1))
      (total (truncate (/ (get-duration 1) cliplen)))
  (dotimes (i total (format nil "~a files exported" total))
    (setf start (* i cliplen))
    (setf end (+ start cliplen))
    (setf cmd (format nil "SelectTime: Start=~s End=~s" start end))
    (aud-do cmd)
    (setf cmd (format nil "Export2: Filename=\"~a~a~a~a\" NumChannels=~s"
                      path fname i ext chan))
    (aud-do cmd)))