https://github.com/badaix/snapcast Does a really good job of latency synchronization and has a timeframe embedded as you say.
For me I keep thinking for distributed network mics for a room it could be amazeballs and really simple.
But if you want to see a really good implementation of timestamp latency correction Snapcast is the one.
Really its not timecode or latency the word we need is ‘Stream’ both Deepspeech and Kaldi can be used in streaming mode.
Deepspeech are going all out with some sort of asynchronous KWS interface for streaming as the problem you have is when your ASR is less than realtime.
If your ASR is less then realtime you are going to get latency but streaming would massively improve things and if you are using a Pi4 or above then Deepspeech is faster than realtime.
Also I don’t know how but the current single thread is supposedly going to muti-thread a stream, how that works is beyond me.
But basically as said ‘Stream’ is the magic word and for an async stream ‘ring buffer’ is probably at least as magical especially if your ASR is less than realtime.
As waiting for ASR end silence will always incur considerable latency.
But actually is it not really simple that vad detected audio is just streamed to ASR and because you know the keyword, just post process STT and remove the Keyword Prexfix.
Then all the KWS needs to do is send an abort on false KWS VAD initiation.
Or when KWS is detected stream audio to a loopback adapter and only stream post KWS audio and just learn your system pause of KWS latency or a ringbuffer or some sort of delay rather than natural will have to be in the stream.
Delay libs and utilities / ringbuffers already exist but hey just learn to pause to your system speed.
As for timecodes again wow it just seems to be Hermes audio is just garnering more function and bloat as already to ASR all we need is a stream which could be as simple and low load as a loopback adapter.
but ALSA has file plugins.
@synesthesiam I think you had it but also doesn’t even need a timestamp, just stream it and abort ASR on KWS failure.