GroovyMorning_RLAC

Time Synchronization and Recalibration: The Challenge of Continuous Audio Streaming between Chronicle Segmenter and Recorder

The RLAC (Real-time Live Audio Chronicle) system from GroovyMorning relies on a distributed architecture where two environments collaborate: a Java (Gradle) backend for recording and a Python (FastAPI) server for artificial intelligence. Maintaining perfect synchronization to the second on a stream running 24/7 is the primary challenge.

The “Master & Subscribers” Architecture

The heart of the recording system (located in 1.RLAC-AudioRecorder) is based on a master stream approach:

The Problem of Detection Latency

When a chronicle capture task listens to the stream, it receives start and end notifications from the AI (the Python server). However, several seconds can elapse between the actual start of the chronicle and its confirmation by the AI (transcription latency, LLM analysis, etc.).

To resolve this offset, a retroactive correction strategy is employed:

  1. Hard Linking: To avoid costly file copies, hard links are created between the “Master” segments and the specific folder for the chronicle.
  2. Accumulation: As soon as a chronicle start is suspected, the system accumulates segments.
  3. Post-hoc Truncation: Once the end signal is sent by the AI with the exact realDuration, the actual end time is recalculated by the Java server. Excess segments, linked by mistake due to latency, are then instantly deleted.

schema-decoupage-flux-enregistrement-en.png

Advantages of the Method

This recalibration mechanism is the key element that transforms sometimes imprecise or late AI detection into a perfectly segmented audio file for the end user.

French version