# kcode-audio-ingress
`kcode-audio-ingress` 0.5.3 provides durable automatic audio transcription
with transport-neutral speaker correction. It retains complete caller-owned
WAV bytes, sends overlapping chunks to Gemini for unstructured speaker
analysis, validates a typed GPT parse, scores speaker rows through a
caller-supplied persistent classifier, reconciles a readable transcript, and
durably exposes one complete correction packet.
The embedding application supplies typed audio and text-generation callbacks
and a shared `Arc<kcode_speech_classification::SpeechClassifier>`. It owns
provider routing, credentials, accounting, classifier storage, object creation,
Kmap storage, and user messaging. This crate adds no provider client, HTTP,
Kmap, Telegram, object-store, or application-framework dependency.
```rust,no_run
use std::sync::Arc;
use chrono::Utc;
use kcode_audio_ingress::{AudioIngress, AudioInput, AudioTranscriber};
use kcode_speech_classification::SpeechClassifier;
async fn accept(
transcriber: AudioTranscriber,
classifier: Arc<SpeechClassifier>,
wav_bytes: Vec<u8>,
) -> Result<(), kcode_audio_ingress::Error> {
let ingress = AudioIngress::open("./audio-ingress", transcriber, classifier).await?;
ingress
.submit(AudioInput {
user_id: "user-root-id".into(),
bytes: wav_bytes,
recorded_at: Utc::now(),
original_filename: Some("recording.wav".into()),
})
.await?;
Ok(())
}
```
The pipeline uses bounded four-minute chunks with 15-second overlap and four
concurrent chunks. Every chunk is sent to `gemini-3.1-pro-preview` with the
exported `GEMINI_SPEAKER_PROMPT_V0_1`; raw responses and validated 24-feature
rows are retained. `gpt-5.6-sol` parses and reconciles the result. A recording
is automatically trained only when every observation passes the strict
confidence/background/runner-up and unique-name gates. Completed status
includes the transcript and correction packet, and `confirm_speakers` requires
exact observation coverage before applying human-confirmed names.
See [Documentation.md](Documentation.md) for the complete API and
[Specification.md](Specification.md) for persistence and lifecycle guarantees.