CustomPanningData
public struct CustomPanningData : Hashable
This class contains all the information regarding the next angular panning element, including
a new estimated audio cue duration, and a new set of initial and sweep angular angle,
allowing the customization of the spatial audio trajectories for any type of notification,
such as speed or merge warners, maneuvers or even roundabouts notifications.
The orientation in space for CustomPanningData.initialAzimuthInDegrees and CustomPanningData.sweepAzimuthInDegrees can
be represented by the following angular values:
| Front | Right | Rear | Left |
|---|---|---|---|
| 0° | +90° | +- 180 | -90° |
When any of the members of CustomPanningData are initialized as null, the default value
provided by HERE SDK will be used instead.
The audio cue is spatialized considering the action of both maneuvers, for example,
the audio cue ‘Now turn right and then turn left’ will be spatialized as following:
‘Now turn right’ will be heard as coming from the right.
‘and then turn left’ will be heard as coming from the left.
Note: The estimation for playing both audio cues could be not fully accurate and therefore
a mismatch between the audio source and the audio cue message could be perceived.
-
Customized estimated duration for playing the audio cue on the selected TTS Engine. When not used, HERE SDK’s estimation will be used instead.
Declaration
Swift
public var estimatedAudioCueDuration: TimeInterval? -
Initial desired angular position of the upcoming audio cue. For example, for a maneuver such as “Turn right on” (
ManeuverAction.RightTurn) we want to create a spatial audio arc from the front to the right, mimicking the maneuver geometry. In this case, it is good practice to start the trajectory from an initial azimuth that is slightly located on the opposite direction of the maneuver (e.g. slightly starting from “front-left”) and terminate the trajectory fully on the right side. The initial azimuth angle of such a trajectory would be, for example, -5.0 (slightly front-left). This azimuth value is needed to set the position of the audio renderer before starting to play the audio cue to avoid unwanted audio “jumps”.Declaration
Swift
public var initialAzimuthInDegrees: Double? -
Sweep angle of the upcoming audio cue. For example, for a maneuver such as “Turn right on” (i.e.
ManeuverAction.RightTurn), within aninitial_azimuth_in_degreesof -5 degrees, we want to create a spatial audio arc trajectory from the front to the right, mimicking the maneuver geometry. In this case, the desired final angle would be +90 degrees, and therefore, a sweep angle of +95 degrees would be required. On the other hand, when the desired spatialization is to the left side (i.e.ManeuverAction.LeftTurn), theinitial_azimuth_in_degreescould be set to +5 degrees and thesweep_azimuth_in_degreesto -95 degreesDeclaration
Swift
public var sweepAzimuthInDegrees: Double? -
Creates a new instance.
Declaration
Swift
public init(estimatedAudioCueDuration: TimeInterval? = nil, initialAzimuthInDegrees: Double? = nil, sweepAzimuthInDegrees: Double? = nil)