I am trying to create a logfile that is being created while Audacity is recording - I need this logfile log:
current CLOCK_MONOTONIC.
current sample number being recorded.
Currently I managed to get a logging function to run on a separate thread (while recording audio) and log CLOCK_MONOTONIC at almost constant time intervals (good enough for what I need) - how, if at all, can I add to this log the number of the audio sample that is being recorded at that time?
What do you mean by “current sample number”? Do you mean you want to count the samples from the start of the recording, or do you mean that you want the sample value?
What’s the job? What are you trying to do?
by “current sample number” I mean the count of the samples from the start of the recording.
I have data from a second machine, that I need to synchronize with the data recorded by audacity.
the reason I need CLOCK_MONOTIONIC is that the way this is done is by performing a synchronization based on the CLOCK_MONOTIONIC and a series of synchronization signals being sent from the pc to that other machine.
waxcylinder - I am trying to log the computer’s clock with the time since recording began in real time, so I need it while the recording is ongoing.
See update below!
steve (or anyone else who might know) - I am having trouble with Pa_GetStreamTime.
I am passing *PaStream mPortStreamV19; (I have changed this PaStream pointer to be public) to my logger function and called Pa_GetStreamTime on it - but although the perror is “success” I keep getting a result of 0.
any idea what I could be doing wrong? am I missing something major here? is the active stream not mPortStreamV19?
Anybody has an idea on how to get the time since beginning of recording in another way? and I need to have a maximum of 1 millisecond inaccuracy.
Thanks again!
Audacity writes “blocks” rather than “frames”.
This is really a user forum rather than a developers forum, so I doubt that anyone here knows all of the code, but I’d suggest that you start looking in AudioIO.cpp and BlockFile.cpp.