Skip to main content

aiostreammagic

An async python package for interfacing with Cambridge Audio / Stream Magic compatible streamers

📖 Read the docs »

GitHub Release Python Versions License

About

This module implements a Python client for the Stream Magic API used to control Cambridge Audio streamers. The API connects over websockets and supports several streamers, receivers, and pre-amps.

Supported Devices

  • Cambridge Audio Evo One
  • Cambridge Audio Evo 75
  • Cambridge Audio Evo 150
  • Cambridge Audio CXN
  • Cambridge Audio CXN V2
  • Cambridge Audio CXN100
  • Cambridge Audio CXR120
  • Cambridge Audio CXR200
  • Cambridge Audio 851N
  • Cambridge Audio Edge NQ
  • Cambridge Audio AXN10

If your model is not on the list of supported devices, and everything works correctly then add it to the list by opening a pull request.

Installation

pip install aiostreammagic

Usage

Basic Example

import asyncio

from aiostreammagic import StreamMagicClient

HOST = "192.168.20.218"


async def main():
    """Basic demo entrypoint."""
    async with StreamMagicClient(HOST) as client:

        print(f"Model: {client.info.model}")

        for source in client.sources:
            print(f"Name: {source.id} ({source.id})")

if __name__ == '__main__':
    asyncio.run(main())

Subscription Example

The Cambridge Audio StreamMagic API can automatically notify the client of changes instead of the need for polling. Register a callback to be called whenver new information is available.

import asyncio

from aiostreammagic import StreamMagicClient

HOST = "192.168.20.218"


async def on_state_change(client: StreamMagicClient):
    """Called when new information is received."""
    print(f"System info: {client.info}")
    print(f"Sources: {client.sources}")
    print(f"State: {client.state}")
    print(f"Play State: {client.play_state}")
    print(f"Now Playing: {client.now_playing}")

async def main():
    """Subscribe demo entrypoint."""
    client = StreamMagicClient(HOST)
    await client.register_state_update_callbacks(on_state_change)
    await client.connect()

    # Play media using the unit's front controls or StreamMagic app
    await asyncio.sleep(60)

    await client.disconnect()


if __name__ == '__main__':
    asyncio.run(main())

Advanced Audio Settings

Balance

Adjust left/right speaker balance (requires pre-amp mode):

async with StreamMagicClient(HOST) as client:
    await client.set_pre_amp_mode(True)
    await client.set_balance(-5)  # Range: -15 (left) to 15 (right)

Room Correction

Enable and adjust tilt EQ for room acoustics (negative values add warmth for bright/hard-surfaced rooms, positive values add brightness for soft/damped rooms):

async with StreamMagicClient(HOST) as client:
    await client.set_room_correction_mode(True)
    await client.set_room_correction_intensity(8)  # Range: -15 to 15

Equalizer

Configure the 7-band parametric equalizer (bands 0-6 at 80, 120, 315, 800, 2000, 5000, 8000 Hz):

from aiostreammagic import EQBand, EQ_PRESETS

async with StreamMagicClient(HOST) as client:
    # Enable equalizer
    await client.set_equalizer_mode(True)

    # Apply a preset ('flat', 'bass_boost', 'bass_reduction',
    # 'voice_clarity', 'treble_boost', 'treble_reduction', 'tv',
    # 'movie', 'gaming')
    await client.set_equalizer_preset("bass_boost")

    # Adjust individual bands (0-6)
    await client.set_equalizer_band_gain(3, 2.5)  # Band 3, +2.5 dB, Range: -6 to +3

    # Set custom gains for all bands
    gains = [1.0, 0.5, 0.0, 0.0, 0.0, 0.5, 1.0]
    bands = [EQBand(index=i, gain=gains[i]) for i in range(7)]
    await client.set_equalizer_params(bands)

    # Reset to defaults
    await client.set_equalizer_defaults()

Metadata

Release files for aiostreammagic 2.13.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiostreammagic 2.13.2
File Size Uploaded
aiostreammagic-2.13.2.tar.gz 14.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiostreammagic 2.13.2
File Interpreter ABI Platform
aiostreammagic-2.13.2-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / aiostreammagic-2.13.2.tar.gz

Download URL aiostreammagic-2.13.2.tar.gz
Size 14.2 kB
Tags Source
SHA-256 checksum
How to use checksums
43b404b176b7b9bb943c29bbd2433fd6e3030c80d3e6a508a8b6b7b94bfd6b5c
BLAKE2b-256 checksum
How to use checksums
1d99bf22b99a1a2f4b70a9a31d62d11407c2eab0bc3f828f4feb19ab488d50c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release files / aiostreammagic-2.13.2-py3-none-any.whl

Download URL aiostreammagic-2.13.2-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e3f7d67b3939b33b3993fb23ccd47b0e05aff6760dd237b15aea073516232b6b
BLAKE2b-256 checksum
How to use checksums
a502e75071e226a030cfde0f6c624aba63834322c2db73bb347207c4c0f8bdcb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.13.2 This release

2 release files

2.13.1

2 release files

2.13.0

2 release files

2.12.1

2 release files

2.11.0

2 release files

2.10.0

2 release files

2.9.0

2 release files

2.8.6

2 release files

2.8.5

2 release files

2.8.4

2 release files

2.8.3

2 release files

2.8.2

2 release files

2.8.1

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5.0

2 release files

2.4.0

2 release files

2.3.1

2 release files

2.3.0

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page