How does Samsung's Voice Recorder's Speech-to-text function store the text and sync it with the audio?
I guess I have found the answer after looking within the M4A files themselves. The text and the timestamps, if I am correct, are stored in the M4A files.
I looked through the binary data of the file using a hex editor and just the normal Notepad application in Windows and I found all the text within a location and it looks like Java was used. I am guessing this is only a feature designed particularly for the Samsung Voice Recorder application.
A sample is shown here (with some parts and most of the weird characters removed):
;com.sec.android.app.voicenote.common.util.VoiceRecorderData 
mCategoryNamet Ljava/lang/String;L mEffectNameq ~  java.util.ArrayListx sizexp 2com.sec.android.app.voicenote.common.util.TextData ConfidenceScoreI dataTypeJ durationJ elapsedTimeJ   timeStamp[ mTextt [Ljava/lang/String; [Ljava.lang.String;{
t The pppppppppsq ~ 
t 
recording pppppppppsq ~ 
t to pppppppppsq ~