Skip to main content

publish Downloads

SteelSeries Sonar Python API

Streamer mode currently in development!

Overview

This Python package provides a convenient interface for interacting with the SteelSeries Sonar application API.
The Sonar application allows users to control and display volumes for various audio channels.

Installation

To use this package, follow these steps:

  1. Install the package using pip:

    pip install steelseries-sonar-py
    
  2. Import the Sonar class in your Python script or application:

    from steelseries_sonar_py import Sonar
    

Usage

Initializing the Sonar Object

The Sonar class accepts two optional parameters during initialization:
streamer_mode: Set to True to use streamer mode (default is False).
app_data_path: Specify a custom path for the SteelSeries Engine 3 coreProps.json file
(default is the default installation path: C:\\ProgramData\\SteelSeries\\SteelSeries Engine 3\\coreProps.json).

sonar = Sonar(app_data_path="C:\\path\\to\\coreProps.json")

or

sonar = Sonar(app_data_path="C:\\path\\to\\coreProps.json", streamer_mode=True)

Streamer Mode

The SteelSeries Sonar Python API supports streamer mode, which allows users to manage two separate sliders: streaming and monitoring. These sliders enable fine-tuned control over different audio channels.

To check if the streamer mode is enabled, use:

is_streaming = sonar.is_streamer_mode()
print("Is Streamer Mode:", is_streaming)

To enable or disable streamer mode, use:

# Enable streamer mode
sonar.set_streamer_mode(True)

# Disable streamer mode
sonar.set_streamer_mode(False)

Retrieving Volume Information

Retrieve information about the current volume settings for all channels:

volume_data = sonar.get_volume_data()
print(volume_data)

Setting Volume for a Channel

Set the volume for a specific channel. The channel parameter should be one of the following:
master, game, chatRender, media, aux, chatCapture. The volume parameter should be a float between 0 and 1.
Additionally, an optional streamer_slider parameter can be provided, with values "streaming" (default) or "monitoring":

channel = "master"
volume = 0.75
streamer_slider = "streaming"  # or "monitoring"

result = sonar.set_volume(channel, volume, streamer_slider=streamer_slider)
print(result)

Muting/Unmuting a Channel

Toggle mute status for a specific channel. The channel parameter should be one of the following:
master, game, chatRender, media, aux, chatCapture. The muted parameter should be a boolean indicating whether to mute (True) or unmute (False) the channel.
Additionally, an optional streamer_slider parameter can be provided, with values "streaming" (default) or "monitoring":

channel = "game"
muted = True
streamer_slider = "monitoring"

result = sonar.mute_channel(channel, muted, streamer_slider=streamer_slider)
print(result)

Chatmix

Retrieve chat-mix data:

chatmix_data = sonar.get_chat_mix_data()
print(chatmix_data)

Set chat-mix value between -1 and 1 to focus sound from the game or chatRender channel:

result = sonar.set_chat_mix(0.5)
print(result)

Exceptions

The package introduces a set of exceptions that might be raised during usage.
It is advisable to handle these exceptions accordingly in your code.
You can import them from steelseries_sonar_py.exceptions. Here is the list of potential exceptions:

  • EnginePathNotFoundError: Raised when SteelSeries Engine 3 is not installed or not in the default location.
  • ServerNotAccessibleError: Raised when the SteelSeries server is not accessible. Provides the HTTP status code.
  • SonarNotEnabledError: Raised when SteelSeries Sonar is not enabled.
  • ServerNotReadyError: Raised when SteelSeries Sonar is not ready.
  • ServerNotRunningError: Raised when SteelSeries Sonar is not running.
  • WebServerAddressNotFoundError: Raised when the web server address is not found.
  • ChannelNotFoundError: Raised when the specified channel is not found.
  • InvalidVolumeError: Raised when an invalid volume value is provided.
  • InvalidMixVolumeError: Raised when an invalid mix volume value is provided.
  • SliderNotFoundError: Raised when an unknown slider name is provided as streamer_slider value.

Example

Here is a complete example demonstrating the usage of the SteelSeries Sonar Python API:

from steelseries_sonar_py import Sonar
from steelseries_sonar_py.exceptions import EnginePathNotFoundError

# Initialize Sonar object
try:
    sonar = Sonar(app_data_path="C:\\path\\to\\coreProps.json")
except EnginePathNotFoundError:
    print("Engine not found!")
    quit()

# Retrieve volume data
volume_data = sonar.get_volume_data()
print("Volume Data:", volume_data)

# Set volume for the 'master' channel
channel = "master"
volume = 0.8
streamer_slider = "streaming"
result = sonar.set_volume(channel, volume, streamer_slider=streamer_slider)
print(f"Set volume for {channel}:", result)

# Mute the 'game' channel
channel = "game"
muted = True
streamer_slider = "monitoring"
result = sonar.mute_channel(channel, muted, streamer_slider=streamer_slider)
print(f"Mute {channel}:", result)

# Retrieve chat-mix data
chatmix_data = sonar.get_chat_mix_data()
print("Chatmix Data:", chatmix_data)

# Set chat-mix value
result = sonar.set_chat_mix(0.5)
print("Set Chatmix:", result)

Special Thanks

Thanks to all contributors who made this package possible - wex for figuring out the API, TotalPanther317 for understanding streamer mode and cookie for features like chat mix and streamer mode detection. Grateful for their efforts!

This documentation now reflects the latest changes and additions to the SteelSeries Sonar Python API.

Metadata

Release files for steelseries-sonar-py 1.2.0

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

Source distribution (sdist)

Source distribution for steelseries-sonar-py 1.2.0
File Size Uploaded Provenance Actions
steelseries_sonar_py-1.2.0.tar.gz 11.0 kB Without provenance Details for steelseries_sonar_py-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for steelseries-sonar-py 1.2.0
File Interpreter ABI Platform Actions
steelseries_sonar_py-1.2.0-py3-none-any.whl Python 3 none any Details for steelseries_sonar_py-1.2.0-py3-none-any.whl

Total release size: 17.6 kB

Release files / steelseries_sonar_py-1.2.0.tar.gz

Download URL steelseries_sonar_py-1.2.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3bb80bcac2443e0bcf8e887885157ff3639775b905500c1920a2593de795f04e
BLAKE2b-256 checksum
How to use checksums
9e02c8f3cc09189e554429805a0f75505758c39f89eb581dc737c951bffc5024
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / steelseries_sonar_py-1.2.0-py3-none-any.whl

Download URL steelseries_sonar_py-1.2.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f4ff0663bbeaf157cd9a2bca91554302680610ff1290c8dcdddfe5394bde8762
BLAKE2b-256 checksum
How to use checksums
8b347d785b25716c8382d068a1b991006f585bfe94d8261a64dc6085daee650b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Security for steelseries-sonar-py 1.2.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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