HERE Android SDK Developer's Guide

AudioPlayer

The class AudioPlayer is a member of com.here.android.mpa.guidance.NavigationManager.

Class Summary

public class NavigationManager.AudioPlayer

extends java.lang.Object

[For complete information, see the section Class Details]

Field Summary

Table 1. Fields in AudioPlayer
Fields

public static final float DEFAULT_AUDIO_VOLUME

Default audio player volume

Method Summary

Table 2. Methods in AudioPlayer
Methods

public int getStreamId ()

Get the current Audio stream used by NavigationManager

public float getVolume ()

Get the Audio Volume used by NavigationManager

public void setDelegate (AudioPlayerDelegate delegate)

Sets NavigationManager.AudioPlayer delegate.

public AudioPlayer setStreamId (int audioStream)

Set the Audio Stream used by NavigationManager .

public AudioPlayer setVolume (float audioVolume)

Set the Audio Volume used by NavigationManager

public void stop ()

Stop the navigation instruction currently being played.

Class Details

Field Details

public static final float DEFAULT_AUDIO_VOLUME

Default audio player volume

Method Details

public int getStreamId ()

Get the current Audio stream used by NavigationManager

Returns:

the current audio stream id. One of the possible values from {code android.media.AudioManager} stream Id constants.

See also:

android.media.AudioManager

public float getVolume ()

Get the Audio Volume used by NavigationManager

Returns:

float A float percentage value in the range of [0.0f, 1.0f] or DEFAULT_AUDIO_VOLUME if a custom value is not set

public void setDelegate (AudioPlayerDelegate delegate)

Sets NavigationManager.AudioPlayer delegate. Clients can implement AudioPlayerDelegate to take over playback of audio files and TTS strings. Note: by delegating NavigationManager.AudioPlayer it immediately stops all current audio and TTS playbacks by the SDK.

Parameters:

  • delegate

public AudioPlayer setStreamId (int audioStream)

Set the Audio Stream used by NavigationManager . By default, android.media.AudioManager.STREAM_MUSIC is used.

Parameters:

  • audioStream

    int android.media.AudioManager for the set of system streams

See also:

android.media.AudioManager

public AudioPlayer setVolume (float audioVolume)

Set the Audio Volume used by NavigationManager

The volume change will not take effect until the next navigation instruction is played. stop() can be used to stop the currently playing instruction.

Parameters:

  • audioVolume

    float A float percentage value in the range of [0.0f, 1.0f]. A value of DEFAULT_AUDIO_VOLUME can be set to use the system default volume.

See also:

stop()

public void stop ()

Stop the navigation instruction currently being played. Future instructions will continue to be played.

This can be used in conjunction with setVolume(float) to mute the navigation audio immediately.

See also:

setVolume(float)

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.