Home > @magiclane/maps-sdk > SoundPlayingService
SoundPlayingService class
High-level static API for playing sounds and TTS through the SDK.
This class exposes only static members and acts as a thin bridge to the native sound engine. Use SoundPlayingListener to observe playback lifecycle events, and SoundPlayingPreferences to configure per-severity playback settings.
Signature:
export declare abstract class SoundPlayingService Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
number |
Get the audio low-latency output frame size (Android only). On iOS this returns 0. | |
|
|
AudioOutput |
Returns the currently selected audio output type. | |
|
|
number |
Returns the current call timing delay (milliseconds). | |
|
|
boolean |
Returns whether automatic playback of TTS instructions is enabled. | |
|
|
number |
Get the native audio output sample rate (Android only). On iOS this returns 0. | |
|
|
Obtain the singleton SoundPlayingListener used to observe playback events. The listener is created once and registered with the platform. Use SoundPlayingListener.registerOnStart and SoundPlayingListener.registerOnStop to receive playback events. | ||
|
|
Return the currently configured sound session request preferences. The returned instance is a copy; set soundSessionRequestPreferences to persist changes. | ||
|
|
Return the Language currently being used in the system as the default TTS language. | ||
|
|
number |
Returns the current voice (TTS) volume. | |
|
|
number |
Returns the current warnings volume. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
|
Cancel currently playing navigation sounds. Use this to immediately stop navigation-related audio playback. | |
|
|
Retrieve sound playback preferences for the given severity. The returned instance is a copy; call setSoundPlayingPreferences to persist modifications. | |
|
|
Play a pre-recorded sound by id. | |
|
|
Play the given text using TTS. | |
|
setSoundPlayingPreferences(soundPlayingPreferences, severity) |
|
Apply sound playback preferences for the given severity. Only fields present in the provided SoundPlayingPreferences instance are applied. To change preferences, modify an instance returned by getSoundPlayingPreferences and call this method to persist the change. This method does not take into account any ongoing system interruptions. |