Skip to main content

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mars_sdk-0.1.2-cp311-abi3-macosx_11_0_arm64.whl (442.4 kB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

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

Hashes for mars_sdk-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fdf4304b90a7da178c28126d97084a13d82f93608a63c58ef0a44d20a723b59c
MD5 a754548cd7ebd195466ff931f838f21e
BLAKE2b-256 d12cfcb1a93121ff94c079f182b1c73b5f865833cdbb9ebc29e6ff696c22b0fd

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

1 file

This release

0.1.2 This release

1 file

0.1.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page