Y
BioPSI SDK v1.0

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.

Python 3.8+  ·  macOS  ·  Windows  ·  16 kHz mono audio

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.

shell
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.

shell
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:

python
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.

python
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.

python
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.

ParameterTypeDescription
usernamestrIdentifier for the user being calibrated.
audio_chunknp.ndarrayAmbient-noise audio. 16 kHz mono, Float32 or Int16.
duration_secondsintTotal 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.

ParameterTypeDescription
usernamestrIdentifier for the user being enrolled.
audio_chunknp.ndarray16,000 samples, 16 kHz mono.
on_progresscallableOptional. Receives a float 0–100.
on_completecallableOptional. 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.

ParameterTypeDescription
usernamestrIdentifier of the previously enrolled user.
audio_chunknp.ndarray16,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.

FieldTypeDescription
has_authboolVerification was run on this chunk.
authenticatedboolChunk matches the enrolled speaker. Read only when has_auth is True.
authorized_audionp.ndarraySame length as input; non-enrolled-speaker samples zeroed out.
has_transcriptionboolA speech pause triggered transcription on this chunk.
textstrTranscribed text. Read only when has_transcription is True.

Audio requirements

Input must match exactly. Mismatches raise InvalidAudioFormatError.

FormatFloat32 or Int16 PCM
Sample rate16,000 Hz
ChannelsMono (1)
Chunk sizeExactly 16,000 samples (1 second)

Errors

All SDK exceptions inherit from YobeError.

ExceptionRaised when
LicenseErrorLicense key is missing, malformed, expired, or revoked.
BinaryNotFoundErroraudio_processor binary missing from the provided path.
InvalidAudioFormatErrorAudio sample rate, channels, dtype, or chunk size is wrong.
ServiceConnectionErrorBackground service unreachable on its TCP port.
UnknownUserErrortest_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.

flow
Your Python application
      ↓ imports
YobeClient  (yobe_client.py)
      ↓ subprocess + TCP
audio_processor  (native binary)
      ↓ processes
Speaker recognition  +  Whisper transcription
  • First call spawns the audio_processor service.
  • Later scripts detect the running service and attach — startup is near-instant.
  • To stop the service manually: python examples/shutdown_service.py.

Project structure

yobe-sdk/ ├── README.md ├── yobe_client.py # Python client library ├── dist/ │ ├── audio_processor # core binary (.exe on Windows) │ └── license.txt # your license key ├── models/ │ └── gmm_model_background_v2.pkl └── examples/ ├── voice_enrollment.py ├── voice_verification.py ├── voice_calibration.py └── shutdown_service.py

System requirements

Python3.8 or higher
Dependenciesnumpy, pyaudio
Operating systemmacOS (Apple Silicon), Windows (x86). Linux in development.
RAM4 GB minimum
CPUAny modern processor (no GPU required)
Storage~300 MB

Bundled examples

Run in this order from a fresh checkout:

shell
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
ScriptOutput
voice_calibration.pyuser_data/user_thresholds.json
voice_enrollment.pyuser_data/enrollments/
voice_verification.py.txt transcript + authorized .wav

Troubleshooting

License file not found

error
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

error
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

error
ServiceConnectionError: Failed to connect to existing service

Stop any stale service and let the next call respawn it:

shell
python examples/shutdown_service.py

Invalid audio format

error
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.