Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class AudioStreamManager

Hierarchy

java.lang.Object
     com.smartdevicelink.managers.BaseSubManager

Package
com.smartdevicelink.managers.audio

Overview

The AudioStreamManager class provides methods to start and stop an audio stream to the connected device. Audio files can be pushed to the manager in order to play them on the connected device. The manager uses the Android built-in MediaCodec.

Fields

Inherited Fields

From Class Fields
com.smartdevicelink.managers.BaseSubManager SETTING_UP, READY, LIMITED, SHUTDOWN, ERROR, internalInterface

Constructors

AudioStreamManager( ISdl internalInterface, Context context )

Creates a new object of AudioStreamManager

public AudioStreamManager(ISdl internalInterface,Context context)

Parameters

internalInterface
The internal interface to the connected device.
context

Methods

start( CompletionListener listener )

public void start(CompletionListener listener)

Parameters

listener

dispose()

public void dispose()

startAudioStream( boolean encrypted, CompletionListener completionListener )

Starts the audio service and audio stream to the connected device. The method is non-blocking.

public void startAudioStream(boolean encrypted,CompletionListener completionListener)

Parameters

encrypted
Specify whether or not the audio stream should be encrypted.
completionListener

stopAudioStream( CompletionListener completionListener )

Stops the audio service and audio stream to the connected device. The method is non-blocking.

public void stopAudioStream(CompletionListener completionListener)

Parameters

completionListener

pushResource( int resourceId, CompletionListener completionListener )

Pushes the specified resource file to the playback queue. The audio file will be played immediately. If another audio file is currently playing the specified file will stay queued and automatically played when ready.

public void pushResource(int resourceId,CompletionListener completionListener)

Parameters

resourceId
The specified resource file to be played.
completionListener
A completion listener that informs when the audio file is played.

pushAudioSource( Uri audioSource, CompletionListener completionListener )

Pushes the specified audio file to the playback queue. The audio file will be played immediately. If another audio file is currently playing the specified file will stay queued and automatically played when ready.

public void pushAudioSource(Uri audioSource,CompletionListener completionListener)

Parameters

audioSource
The specified audio file to be played.
completionListener
A completion listener that informs when the audio file is played.

onTransportUpdate( java.util.List<com.smartdevicelink.transport.utl.TransportRecord> connectedTransports, boolean audioStreamTransportAvail, boolean videoStreamTransportAvail )

protected void onTransportUpdate(java.util.List<com.smartdevicelink.transport.utl.TransportRecord> connectedTransports,boolean audioStreamTransportAvail,boolean videoStreamTransportAvail)

Parameters

connectedTransports
audioStreamTransportAvail
videoStreamTransportAvail

Inherited Methods

From Class Methods
com.smartdevicelink.managers.BaseSubManager start, dispose, transitionToState, getState, handleTransportUpdated, onTransportUpdate
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section