Getting time while recording with pipe

Hi,
I can start recording with python and pipe, I can stop the recording, but how can I get the current PlayHead position (while recording and later while playing)??

Thanks for your help.

In most cases you should set the cursor position explicitly rather than trying to figure out where it is.

To get the position during play or record you would have to get that from Python rather from Audacity because it is not possible to run other commands during record or playback. For example, if you set the cursor to the beginning (time = 0) and play for 30 seconds, then the cursor should be at time = 30.

When playback is stopped, you can get the cursor position using the command:

GetInfo: type=Selection

The command appears to have been added around Audacity version 3.6 but itis not documented in the Scripting Reference because the documentation is not being kept up to date. However, the syntax is the same as for other GetInfo: commands and the default output is formatted as JSON.