Documentation Index
Fetch the complete documentation index at: https://developer.sanas.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This tutorial demonstrates how to process multiple concurrent audio streams using the Sanas SDK with dummy audio data. You’ll learn how to:- Share a single SDK instance across streams
- Manage per-stream processors and state
- Process multiple simultaneous audio streams
Use cases: Contact centers, conference platforms, multi-user applications, gaming voice chat servers.
Prerequisites
Sanas SDK is installed and configured. See Quick Start.Handle Multiple Streams
To handle multiple audio streams, we’ll use aThreadPoolExecutor to run each call in its own thread, with a shared SDK instance and a separate AudioProcessor per stream.
This example uses a
ThreadPoolExecutor for demonstration purposes. In production, use any concurrency model (threads, asyncio, etc.) - each stream just needs its own AudioProcessor and must maintain precise 20ms timing between chunks.Key Components
| Component | Scope | Purpose |
|---|---|---|
| SDK Instance | Global | Shared connection to the Sanas server |
| Audio Processor | Per-thread | Independent audio processing |
| Threading Event | Per-thread | State synchronization |
| Thread Pool | Global | Manages concurrent execution |
References
RemoteSDK
SDK lifecycle methods including CreateAudioProcessor and DestroyAudioProcessor.
AudioProcessor
ProcessSamples and GetState methods for audio processing.
Need Help?
Email Support
support@sanas.aiResponse time: 1 business day
Support Portal
Raise a support ticket for urgent issues