Skip to main content

Overview

This guide will walk you through processing your first audio stream using the Sanas SDK.
This guide uses Sanas Cloud. For deployment options, see Deployment.

Prerequisites

Make sure your environment meets the following system requirements before installing the SDK:
  • OS Version: Ubuntu 22.04 x86-64
  • Python Version: 3.10 or higher
Mac and Windows support coming soon.
To authenticate with Sanas Cloud, you’ll need an Account ID, Account Secret, and a Remote Endpoint URL. These credentials are provided in your welcome email after requesting access.If you don’t have credentials yet, request SDK access to get started.

Step 1: Install the SDK

  1. Download your SDK connector file (e.g., sanas_remote_sdk_<platform-arch>_<version>.tar.gz) included in the welcome email from Sanas.
  2. Extract the archive:
tar -zxvf sanas_remote_sdk_<platform-arch>_<version>.tar.gz
  1. Change directory into the extracted folder:
cd <extracted-folder-name> # Replace with the actual folder name you see
The extracted folder name is usually similar to the tar.gz file name. Check the exact name after extraction.
  1. Run the installer:
./install.sh

Step 2: Verify Installation

Activate the SDK environment and test:
source sanas_remote_sdk/bin/activate
python3 -c "import sanas_remote_sdk; print('SDK installed successfully!')"
This ensures your SDK is initialized correctly and ready for use.

Step 3: Select Your Model

Choose the AI model that fits your use case:
ModelUse CaseBehaviorBest For
AGENTIC_VI_G_NC
Agentic NC · Voice Isolation (General)
Human ↔ MachineFull voice isolationVoice agents, IVR, STT
AGENTIC_ST_NC
Agentic NC · Standard
Human ↔ MachinePreserves distant speechMulti-speaker, panels, meetings
VI_G_NC3.0
NC · Voice Isolation (General)
Human ↔ HumanIsolates intended speechContact centers, conferencing, gaming
View full model comparison →

Step 4: Process Your First Audio Stream

Create a new Python file audio_stream_quickstart.py and copy the following code into the file.
import sanas_remote_sdk

# Initialize SDK
sdk = sanas_remote_sdk.CreateRemoteSDK()

init_params = sanas_remote_sdk.InitParams()
init_params.remoteEndpoint = "your_endpoint_url"  # From credentials email
init_params.accountId = "your_account_id"
init_params.accountSecret = "your_account_secret"
init_params.secureMedia = True

result = sdk.Initialize(init_params)
print(f"SDK initialized: {'SUCCESS' if result == sanas_remote_sdk.InitSDKResult.SUCCESS else 'FAILED'}")

# State callback
def state_callback(state, reason):
    if state == sanas_remote_sdk.ProcessorState.READY:
        print("Processor ready!")

# Create an audio processor (full voice isolation)
audio_params = sanas_remote_sdk.AudioParams()
audio_params.modelName = "AGENTIC_VI_G_NC"
audio_params.sampleRate = 16000  # Define source audio sampling rate

processor, create_result = sdk.CreateAudioProcessor(audio_params, state_callback)

if create_result == sanas_remote_sdk.CreateProcessorResult.SUCCESS:
    # Process audio chunks (dummy data)
    # 20 ms of audio at 16 kHz -> 20ms * 16kHz = 320 samples
    num_samples = 320
    dummy_amplitude = 0.1
    input_audio = [dummy_amplitude] * num_samples
    output_audio = processor.ProcessSamples(input_audio)
    print(f"Processed {len(output_audio)} samples")

    # You can now send output_audio to your ASR system

    sdk.DestroyAudioProcessor(processor)

sdk.Shutdown()

Step 5: Run the Code

Run the code and the console will print out the SDK initialization and the processed samples.
python audio_stream_quickstart.py

Next Steps

Now that you’ve successfully processed a single audio stream with the Sanas SDK, you can move on to handling multiple concurrent streams.

Processing Multiple Streams

Scale to multiple concurrent audio streams with a shared SDK instance.

References

RemoteSDK

SDK lifecycle methods including Initialize, CreateAudioProcessor, and Shutdown.

AudioProcessor

ProcessSamples and GetState methods for audio processing.

AudioParams

Model selection and sample rate configuration.

InitParams

SDK connection configuration including endpoint and credentials.

Need Help?

Email Support

support@sanas.aiResponse time: 1 business day

Support Portal

Raise a support ticket for urgent issues