Yobe BioPSI SDK
A Python SDK for real-time speaker verification, ambient calibration, and transcription. Processes 1-second audio chunks on-device. No GPU required.
The SDK provides five capabilities:
- Ambient calibration. Set a per-user energy threshold from background noise.
- Speaker enrollment. Train a voice profile from streamed audio chunks.
- Speaker verification. Confirm whether a chunk contains speech from the enrolled user (1:1).
- Transcription. Whisper-based speech-to-text, emitted on detected pauses.
- Real-time streaming. 1-second chunked processing.
Evaluation license. The SDK ships under a non-commercial evaluation license. Keys may be revoked or expire. See License before integrating.
Installation
1. Extract the SDK into your project directory.
2. Install Python dependencies.
pip install numpy pyaudio
3. Place the binary. Copy the audio_processor binary (delivered with your license email) into ./dist/. On Windows this is audio_processor.exe.
4. Add your license file.
echo "YOUR-LICENSE-KEY" > dist/license.txt
The final ./dist/ directory should contain audio_processor and license.txt.
Hello world
Verify the SDK loads and the license is valid:
from yobe_client import YobeClient with YobeClient('./dist/audio_processor') as client: print("SDK initialized.")
If this runs without an exception, the binary started and the license validated.
Core workflow
The integration has three stages: calibrate, enroll, verify. The example below uses pyaudio to capture from the default microphone.
from yobe_client import YobeClient import numpy as np import pyaudio def record_chunk(stream, samples=16000): raw = stream.read(samples, exception_on_overflow=False) return np.frombuffer(raw, dtype=np.int16).astype(np.float32) pa = pyaudio.PyAudio() stream = pa.open(format=pyaudio.paInt16, channels=1, rate=16000, input=True, frames_per_buffer=16000) with YobeClient('./dist/audio_processor') as client: # 1. Calibrate to the environment ambient = np.concatenate([record_chunk(stream) for _ in range(3)]) cal = client.calibrate_chunk("alice", ambient, duration_seconds=3) print(f"Threshold: {cal.threshold}") # 2. Enroll: stream chunks until train_chunk returns True while True: done = client.train_chunk( "alice", record_chunk(stream), on_progress=lambda p: print(f"Training: {p:.1f}%"), on_complete=lambda: print("Done."), ) if done: break # 3. Verify + transcribe in real time while True: result = client.test_chunk("alice", record_chunk(stream)) if result.has_auth and result.authenticated: authorized = result.authorized_audio # non-enrolled speech zeroed if result.has_transcription: print(result.text)
Calibration is per-user and per-environment. Recalibrate when the user changes locations (laptop, office, car) or the noise floor shifts meaningfully.
API
YobeClient(binary_path)
Constructs a client and starts (or attaches to) the background service. Auto-detects the .exe extension on Windows. Use as a context manager for automatic cleanup.
client = YobeClient(binary_path='./dist/audio_processor') # or with YobeClient('./dist/audio_processor') as client: ...
client.calibrate_chunk(username, audio_chunk, duration_seconds=3)
Establishes a per-user energy threshold from ambient noise. The threshold is persisted automatically.
| Parameter | Type | Description |
|---|---|---|
| username | str | Identifier for the user being calibrated. |
| audio_chunk | np.ndarray | Ambient-noise audio. 16 kHz mono, Float32 or Int16. |
| duration_seconds | int | Total noise duration. 3 or more recommended. |
Returns an object with a threshold attribute (float).
client.train_chunk(username, audio_chunk, on_progress=None, on_complete=None)
Streams a 1-second chunk into the user's voice profile. Call repeatedly until it returns True.
| Parameter | Type | Description |
|---|---|---|
| username | str | Identifier for the user being enrolled. |
| audio_chunk | np.ndarray | 16,000 samples, 16 kHz mono. |
| on_progress | callable | Optional. Receives a float 0–100. |
| on_complete | callable | Optional. No arguments. |
Returns True once sufficient training data has been collected.
client.test_chunk(username, audio_chunk)
Runs verification on the chunk and, when a pause is detected, transcription.
| Parameter | Type | Description |
|---|---|---|
| username | str | Identifier of the previously enrolled user. |
| audio_chunk | np.ndarray | 16,000 samples, 16 kHz mono. |
Returns a result object — see Result objects.
client.reset(username, mode)
Clears session state. mode is "train", "test", or "both".
client.close()
Gracefully shuts down the client. Called automatically by the context manager.
Result objects
Always check the has_* flags before reading the corresponding value.
| Field | Type | Description |
|---|---|---|
| has_auth | bool | Verification was run on this chunk. |
| authenticated | bool | Chunk matches the enrolled speaker. Read only when has_auth is True. |
| authorized_audio | np.ndarray | Same length as input; non-enrolled-speaker samples zeroed out. |
| has_transcription | bool | A speech pause triggered transcription on this chunk. |
| text | str | Transcribed text. Read only when has_transcription is True. |
Audio requirements
Input must match exactly. Mismatches raise InvalidAudioFormatError.
| Format | Float32 or Int16 PCM |
| Sample rate | 16,000 Hz |
| Channels | Mono (1) |
| Chunk size | Exactly 16,000 samples (1 second) |
Errors
All SDK exceptions inherit from YobeError.
| Exception | Raised when |
|---|---|
| LicenseError | License key is missing, malformed, expired, or revoked. |
| BinaryNotFoundError | audio_processor binary missing from the provided path. |
| InvalidAudioFormatError | Audio sample rate, channels, dtype, or chunk size is wrong. |
| ServiceConnectionError | Background service unreachable on its TCP port. |
| UnknownUserError | test_chunk() called for a user with no enrollment. |
Thread safety. YobeClient instances are not thread-safe. Multiple processes may connect to the underlying service, but a single client should be confined to one thread or guarded with a lock.
How it works
The SDK runs a persistent local service. The first call in any process launches it; subsequent scripts attach over loopback TCP.
Your Python application
↓ imports
YobeClient (yobe_client.py)
↓ subprocess + TCP
audio_processor (native binary)
↓ processes
Speaker recognition + Whisper transcription
- First call spawns the
audio_processorservice. - Later scripts detect the running service and attach — startup is near-instant.
- To stop the service manually:
python examples/shutdown_service.py.
Project structure
System requirements
| Python | 3.8 or higher |
| Dependencies | numpy, pyaudio |
| Operating system | macOS (Apple Silicon), Windows (x86). Linux in development. |
| RAM | 4 GB minimum |
| CPU | Any modern processor (no GPU required) |
| Storage | ~300 MB |
Bundled examples
Run in this order from a fresh checkout:
cd examples python voice_calibration.py # 1. calibrate threshold (run first) python voice_enrollment.py # 2. enroll a user voice profile python voice_verification.py # 3. verify in real time python shutdown_service.py # stop background service when done
| Script | Output |
|---|---|
| voice_calibration.py | user_data/user_thresholds.json |
| voice_enrollment.py | user_data/enrollments/ |
| voice_verification.py | .txt transcript + authorized .wav |
Troubleshooting
License file not found
LicenseError: License file not found at: ./dist/license.txt
Create license.txt alongside the audio_processor binary and paste your key into it.
Binary not found
FileNotFoundError: Binary not found at: ./dist/audio_processor
Confirm dist/ is in your project root with the correct binary for your OS (.exe on Windows).
Service connection error
ServiceConnectionError: Failed to connect to existing service
Stop any stale service and let the next call respawn it:
python examples/shutdown_service.py
Invalid audio format
InvalidAudioFormatError: Invalid audio format
Audio must be 16 kHz, mono, Float32 or Int16, and exactly 16,000 samples per chunk.
License
SDK Evaluation Agreement (non-commercial). Copyright © 2026 Yobe Inc.
License grant
The SDK is provided as a compiled library for evaluation and testing purposes only. Yobe Inc. grants a personal, non-exclusive, non-transferable license to integrate the SDK into development projects for internal exploration.
Prohibited uses
You agree not to:
- Commercialize — no production use, commercial product, or third-party service offering.
- Reverse engineer — no decompiling, disassembly, or source-code derivation.
- Distribute — no sharing, renting, leasing, or sublicensing of the binaries.
- Bypass — no circumvention of license-key validation or technical restrictions.
License keys
Operation requires a valid license key issued by Yobe Inc. Keys are tied to the evaluation period and may be revoked or expired at Yobe's discretion.
Ownership
The SDK and all intellectual property rights remain the sole property of Yobe Inc.
Limitation of liability
The SDK is provided "AS IS." To the maximum extent permitted by law, Yobe Inc. shall not be liable for any damages arising out of the use or inability to use the SDK.
Support
Technical support, integration help, or licensing questions: contact.us@yobeinc.com
For implementation patterns, see the examples/ directory.