MARS Python SDK
Arm64 macOS SDK for applications that own MARS virtual input devices. The async control client uses IPC protocol v3 and its native extension delegates shared-memory writes to the existing Rust SDK.
Install
uv add mars-sdk
The wheel requires Apple Silicon macOS, CPython 3.11 or newer, and an installed MARS runtime.
Build from this repository
uv sync --locked
Run the complete example with uv run python examples/virtual_mic.py.
Declare and write a virtual microphone
from array import array
from mars_sdk import AppVirtualInputSpec, MarsClient
client = MarsClient()
result = await client.set_virtual_inputs(
"com.example.recorder",
[
AppVirtualInputSpec(
id="mic",
name="Recorder Mic",
uid="com.example.recorder.mic",
sample_rate=48_000,
channels=1,
)
],
)
writer = result.virtual_mics[0].open_live_writer()
writer.write_f32_interleaved_live(array("f", [0.0] * 480))
writer.flush_silence()
writer.close()
set_virtual_inputs atomically replaces the app's complete collection. Pass
an empty list to delete that app's collection. Declarations survive daemon
restart and mars clear; submit the same complete collection again when the
app needs fresh writer handles.
The public control API is ping, status, set_virtual_inputs,
get_virtual_inputs, and read-only virtual_input_status. Inputs are fixed
at 48 kHz and support mono or stereo. Each id is app-local; each uid must
be globally unique. The Python writer accepts a C-contiguous Float32 buffer
and copies each submitted chunk into native memory before writing it.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mars_sdk-0.1.2-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: mars_sdk-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 442.4 kB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdf4304b90a7da178c28126d97084a13d82f93608a63c58ef0a44d20a723b59c
|
|
| MD5 |
a754548cd7ebd195466ff931f838f21e
|
|
| BLAKE2b-256 |
d12cfcb1a93121ff94c079f182b1c73b5f865833cdbb9ebc29e6ff696c22b0fd
|