I have a python program that has .35 to .89 second overhead every time the pause/play button is pressed. As such the internal calculation for how much time has been previously played is being skewed.
Using this answer from the shell (not yet incorporated into a script though) I can use:
$ ps aux | grep -v grep | grep ffplay
rick 16075 0.2 0.1 949956 45384 pts/22 Tl+ 09:28 0:02 ffplay -autoexit /media/rick/SANDISK128/Music/Alice Cooper/Welcome To My Nightmare/01 Welcome To My Nightmare.m4a -nodisp
$ sudo strace -p16075 -s9999 -e write
strace: Process 16075 attached
write(2, " 44.44 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.47 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.49 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.54 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.56 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.59 M-A: -0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.64 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.66 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.68 M-A: 0.000 fd= 0 aq= 23KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.72 M-A: -0.000 fd= 0 aq= 22KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.75 M-A: -0.000 fd= 0 aq= 22KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.77 M-A: 0.000 fd= 0 aq= 22KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
write(2, " 44.82 M-A: -0.000 fd= 0 aq= 21KB vq= 0KB sq= 0B f=0/0 \r", 69) = 69
^Cstrace: Process 16075 detached
The first variable is the amount of seconds passed, or 44.82 in this case.
In contrast in the python program where pause/play has been clicked a dozen times the calculated time is 53.31 a difference of 8 1/2 seconds.
Some fine-tuning is required to call strace
without sudo
permissions and to have it exit after dumping the last line only.