Quickstart
Requirements
Section titled “Requirements”Use the tool versions in the repository mise.toml, or Elixir 1.18 or later
with a compatible OTP version.
git clone https://github.com/flowcopilot/audioflow.gitcd audioflowmise installmix deps.getRun the core
Section titled “Run the core”The core runs without model downloads. The demo adapters produce fixed text and silent PCM.
mix testmix run examples/demo.exsmix audio_flow.bench --runs 20 --concurrency 4Start a session
Section titled “Start a session”{:ok, session} = AudioFlow.start_session(AudioFlow.Adapters.Demo.options())audio = %AudioFlow.Audio{data: <<0, 0>>, sample_rate: 16_000}{:ok, turn} = AudioFlow.submit(session, audio)
receive do {AudioFlow, ^session, ^turn, event} -> IO.inspect(event)end
AudioFlow.cancel(session)AudioFlow.stop_session(session)The owner process receives transcript, text, audio, and terminal events for the turn. See Sessions for the rules.
Send a typed message
Section titled “Send a typed message”{:ok, turn} = AudioFlow.submit(session, %AudioFlow.Text{data: "Hello"})Text turns skip speech recognition. The reply uses the same speech synthesis and history path as a voice turn.
Use real models
Section titled “Use real models”Enable the model code, then run an example with real inference:
AUDIOFLOW_ML=1 mix deps.getAUDIOFLOW_ML=1 mix run examples/kokoro.exs "Hello from AudioFlow." output.wavKokoro needs espeak-ng for text input (brew install espeak-ng on macOS).
See Local models.
Examples
Section titled “Examples”| File | Shows |
|---|---|
examples/demo.exs |
A session with demo adapters |
examples/routing.exs |
Model routing without downloads |
examples/http.exs |
One HTTP chat request |
examples/kokoro.exs |
Kokoro speech to a WAV file |
examples/vad.exs |
Silero voice detection on a PCM file |
examples/local.exs |
Whisper, Qwen3, and Kokoro for benchmarks |
examples/media.exs |
PCM file input to speaker output |
examples/conversation.exs |
Sequential turns with history |
examples/multimodal.exs |
Embeddings and image captions |
examples/video.exs |
Descriptions of sampled video frames |
examples/models.exs |
Shared model services for the other examples |
examples/transcribe.exs |
Captions for a WAV file through any STT adapter |
examples/websocket.exs |
The browser WebSocket demo |
examples/chat |
A LiveView voice and text chat |