Audio Player Communicating with for loop

Hello there,

I have used Streamlit for a project where the goal was to record sensor data along side audio from special microphones and to be able to view them and look for correlations between sound and data.

I am at the stage now where whilst the recordings are being made I can view the live sensor output whilst listening but I need to find a way to play back old recordings and view the historical data in the same way.

Right now via Sreamlit i can select old audio and old data and listen/view them separately, what I need is a way to tell the current state of the st.audio widget player, is playing, is paused, at time code etc. Then I can use this to play back the data in a for loop in sync, so far i cannot figure out a way. Would it perhaps be possible to make a custom button that operates the audio player?

Thanks for reading…
S.

TLDR; Would be great to have a return from the media player that signals if its playing,paused, stopped as well as what the time code is … I don’t suppose anyone could help?